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.