struct Diorite::FrameLineBatch2D

Overview

Stack-allocated 2D vertex and color batch buffer carved out of Lapis::Core::FrameArena.

Defined in:

diorite/core/frame_arena_batch.cr

Constant Summary

DEFAULT_CAPACITY = 4096

Constructors

Instance Method Summary

Constructor Detail

def self.from_arena(arena : Lapis::Core::FrameArena = Lapis::Core::FrameArena.current, max_vertices : Int32 = DEFAULT_CAPACITY) : FrameLineBatch2D #

Allocates a paired 2D vertex + color batch from arena.


def self.new(verts : ArenaVertexBuffer(Godot::Vector2), cols : ArenaVertexBuffer(Godot::Color)) #

Instance Method Detail

def capacity : Int32 #

def clear : self #

def color_arena_buffer : Lapis::Core::ArenaBuffer(Godot::Color) #

def colors : Slice(Godot::Color) #

Zero-allocation Slice(Godot::Color) view over all written 2D vertex colors.


def cols : ArenaVertexBuffer(Godot::Color) #

def empty? : Bool #

def full? : Bool #

def line_count : Int32 #

def push_line(from : Godot::Vector2, to : Godot::Vector2, from_color : Godot::Color, to_color : Godot::Color) : Bool #

def push_line(from : Godot::Vector2, to : Godot::Vector2, color : Godot::Color) : Bool #

def push_vertex(vertex : Godot::Vector2, color : Godot::Color) : Bool #

def remaining : Int32 #

def size : Int32 #

def vertex_arena_buffer : Lapis::Core::ArenaBuffer(Godot::Vector2) #

def vertex_count : Int32 #

def vertices : Slice(Godot::Vector2) #

Zero-allocation Slice(Godot::Vector2) view over all written 2D vertices.


def verts : ArenaVertexBuffer(Godot::Vector2) #