Layers are created using the routines CreateUpfrontLayer() and CreateBehindLayer(). CreateUpfrontLayer() creates a layer that will appear in front of any existing layers. struct Layer *CreateUpfrontLayer( struct Layer_Info *li, struct BitMap *bm, long x0, long y0, long x1, long y1, long flags, struct BitMap *bm2 ); CreateBehindLayer() creates a layer that appears behind existing layers, but in front of backdrop layers. struct Layer *CreateBehindLayer( struct Layer_Info *li, struct BitMap *bm, long x0, long y0, long x1, long y1, long flags, struct BitMap *bm2 ); Both of these routines return a pointer to a Layer data structure (as defined in the include file <graphics/layers.h>), or NULL if the operation was unsuccessful. A New Layer Also Gets a RastPort. --------------------------------- When a layer is created, the routine automatically creates a RastPort to go along with it. If the layer's RastPort is passed to the drawing routines, drawing will be restricted to the layer. See "The Layer's RastPort" section above. Use the DeleteLayer() call to remove a layer: LONG DeleteLayer( long dummy, struct Layer *layer ); DeleteLayer() removes a layer from the layer list and frees the memory allocated by the layer creation calls listed above.