Expand description

Layer API. Allows creation and manipulation of layers including the primary draw target, a layer 0.

let layer_id = olc::layer::create_layer();
// By default, the layer is disabled.
olc::layer::enable_layer(1, true);

olc::layer::set_draw_target(layer_id);

// Will be drawn onto the layer 1.
olc::draw(0, 0, olc::RED);

// Returns the current layer description.
let layer_desc = olc::layer::get_draw_target(1);

// Reset to the primary draw target.
olc::layer::set_primary_draw_target();

Structs

  • Mirror of the olc::LayerDesc. Contains layer description, must be treated as read-only since no modifications to the object are propagated back to the engine. Does not support Clone and Copy, used as a container for layer information.

Functions