Header menu logo Mibo.Raylib

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

RenderBuffer2D(?capacity)

Full Usage: RenderBuffer2D(?capacity)

Parameters:
    ?capacity : int

Returns: RenderBuffer2D
?capacity : int
Returns: RenderBuffer2D

Instance members

Instance member Description

this.Add

Full Usage: this.Add

Parameters:

Adds a render command to the buffer.

cmd : Command2D

this.Clear

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.

this.Count

Full Usage: this.Count

Returns: int

The number of commands currently in the buffer.

Returns: int

this[i]

Full Usage: this[i]

Parameters:
    i : int

Returns: Command2D

Gets the command at the specified index.

i : int
Returns: Command2D

this.Sort

Full Usage: this.Sort

Sorts commands by layer in ascending order. Must be called after RenderBuffer2D.Clear and population, before iteration.

Type something to start searching.