RenderBuffer2D Type
An allocation-free buffer for 2D render commands, sorted by layer.
Commands are accumulated each frame via RenderBuffer2D.Add, sorted by layer, then executed in order via pattern matching. Uses ArrayPool for the backing store to avoid per-frame heap allocations. The buffer is designed to be cleared and repopulated each frame. RenderBuffer2D.Clear resets the count without deallocating the internal array.
Constructors
| Constructor |
Description
|
|
|
Instance members
| Instance member |
Description
|
Adds a render command to the buffer.
|
|
Full Usage:
this.Clear
|
Clears all commands from the buffer without deallocating the backing array. Call this at the start of each frame before populating with new commands. |
Full Usage:
this.Count
Returns: int
|
The number of commands currently in the buffer.
|
Full Usage:
this.Sort
|
Sorts commands by layer in ascending order. Must be called after RenderBuffer2D.Clear and population, before iteration. |
Mibo.Raylib