class Diorite::DebugCommandQueue

Overview

Centralized, high-throughput command queue managing both single-frame and timed debug primitives.

Thread-safe and designed to process thousands of queued items per frame with zero GC allocations.

Defined in:

diorite/core/debug_command.cr

Instance Method Summary

Instance Method Detail

def build_frame_batches(arena : Lapis::Core::FrameArena = Lapis::Core::FrameArena.current, cap_3d_on_top : Int32 = 8192, cap_3d_depth : Int32 = 4096, cap_2d : Int32 = 4096) : FrameDrawBuffers #

Allocates per-frame 2D and 3D vertex/color batches from Lapis::Core::FrameArena and compiles all active commands and telemetry graphs into them.


def channel_enabled?(name : String) : Bool #

Returns true if the channel is currently enabled.


def clear : Void #

Alias for #clear_all.


def clear_all : Void #

Clears all active commands, trails, and telemetry graphs.


def commands_2d : Array(Command2D) #

Active 2D primitives queued for rendering.


def commands_3d : Array(Command3D) #

Active 3D primitives queued for rendering.


def disable_channel(name : String) : Void #

Disables a filtered channel, suppressing all associated commands.


def disabled_channels : Set(String) #

Explicitly disabled channel names.


def enable_channel(name : String) : Void #

Enables a filtered channel.


def enabled : Bool #

Master switch toggling all debug drawing on/off.


def enabled=(enabled : Bool) #

Master switch toggling all debug drawing on/off.


def frame_time_us : Float64 #

def frame_time_us=(frame_time_us : Float64) #

def freeze! : Void #

Freezes debug drawing decay for spatial inspection.


def frozen : Bool #

Pauses frame decay allowing static freecam inspection of active debug shapes.


def frozen=(frozen : Bool) #

Pauses frame decay allowing static freecam inspection of active debug shapes.


def frozen? : Bool #

Returns whether the debug queue is frozen.


def push_2d(cmd : Command2D) : Void #

Pushes a 2D primitive command into the rendering queue.


def push_3d(cmd : Command3D) : Void #

Pushes a 3D primitive command into the rendering queue.


def push_text_2d(cmd : TextCommand2D) : Void #

Pushes a 2D canvas text command into the queue.


def push_text_3d(cmd : TextCommand3D) : Void #

Pushes a 3D billboard text command into the queue.


def step_and_clean(delta : Float64) : Void #

Advances time on duration commands and purges expired or single-frame items.


def telemetry_graphs : Hash(String, TelemetryGraph) #

Active real-time telemetry graphs indexed by metric title.


def text_2d : Array(TextCommand2D) #

Active 2D canvas text labels.


def text_3d : Array(TextCommand3D) #

Active 3D billboard text labels.


def toggle_freeze! : Void #

Toggles freeze state.


def trails : Hash(String, Array(Godot::Vector3)) #

Entity history trails indexed by unique entity ID.


def unfreeze! : Void #

Unfreezes debug drawing decay.


def update_graph(title : String, val : Float32, rect : Godot::Rect2, min_val : Float32, max_val : Float32, color : Godot::Color) : TelemetryGraph #

Pushes a new data sample val into telemetry graph title, creating the graph if needed.


def update_trail(id : String, pt : Godot::Vector3, max_pts : Int32) : Array(Godot::Vector3) #

Appends a coordinate pt to the entity motion trail id, capping length at max_pts.


def verts_2d_last_frame : Int32 #

def verts_2d_last_frame=(verts_2d_last_frame : Int32) #

def verts_3d_last_frame : Int32 #

Performance telemetry counters.


def verts_3d_last_frame=(verts_3d_last_frame : Int32) #

Performance telemetry counters.