Comprehensive 2D rendering toolkit: batched-quad RenderFrame, atlas quad geometry, color helpers, debug overlay/profiler, color-matrix transforms.
Dependencies
pub(all) struct AtlasQuad2D {
source : AtlasDrawSource
left : Double
top : Double
right : Double
bottom : Double
uniform_dwords : Array[Int]
}fn AtlasQuad2D::new(source~ : AtlasDrawSource, left~ : Double, top~ : Double, right~ : Double, bottom~ : Double, uniform_dwords? : Array[Int]) -> AtlasQuad2Dpub(all) struct FrameProfile {
fps : Double
frame_time_ms : Double
update_ms : Double
draw_ms : Double
gpu_frame_ms : Double
draw_calls : Int
vertex_count : Int
asset_inflight : Int
} derive(Debug)impl Show for FrameProfilepub(all) struct Line2D {
x0 : Double
y0 : Double
x1 : Double
y1 : Double
width : Double
color : Color
}fn RectFill2D::new(x~ : Double, y~ : Double, w~ : Double, h~ : Double, color~ : Color) -> RectFill2Dpub(all) struct RectOutline2D {
x : Double
y : Double
w : Double
h : Double
line_width : Double
color : Color
}fn RectOutline2D::new(x~ : Double, y~ : Double, w~ : Double, h~ : Double, line_width? : Double, color~ : Color) -> RectOutline2Dpub(all) struct RenderFrame2D {
dst : ImageHandle
shader : ShaderHandle
screen_w : Int
screen_h : Int
pipeline_id : Int
uniform_hash : Int
blend : BlendMode
}fn RenderFrame2D::new(dst~ : ImageHandle, shader~ : ShaderHandle, screen_w~ : Int, screen_h~ : Int, pipeline_id? : Int, uniform_hash? : Int, blend? : BlendMode) -> RenderFrame2Dimpl Show for SVGRenderResultpub struct TrianglePayload {
has_payload : Bool
ax : Double
ay : Double
bx : Double
by : Double
cx : Double
cy : Double
au : Double
av : Double
bu : Double
bv : Double
cu : Double
cv : Double
uniform_r : Double
uniform_g : Double
uniform_b : Double
uniform_a : Double
texture_seed : Int
} derive(Debug)impl Show for TrianglePayloadfn append_atlas_quad(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, quad : AtlasQuad2D) -> Unitfn append_dot_text(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, text : DotText2D) -> Unitfn append_line(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, line : Line2D) -> Unitfn append_number(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, number : Number2D) -> Unitfn append_primitive_batch(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, vertex_data : Array[Double], indices : Array[Int], color : Color) -> Unitfn append_rect_fill(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, rect : RectFill2D) -> Unitfn append_rect_fill_geometry(vertices : Array[Double], indices : Array[Int], frame : RenderFrame2D, rect : RectFill2D) -> Unitfn append_rect_outline(commands : Array[DrawTrianglesCommand], frame : RenderFrame2D, rect : RectOutline2D) -> Unitfn atlas_quad_vertex_data(source : AtlasDrawSource, left : Double, top : Double, right : Double, bottom : Double) -> Array[Double]fn build_input_debug_overlay(dst : ImageHandle, shader : ShaderHandle, snapshot : InputSnapshot, key_state : KeyInputState, mouse_state : MouseButtonInputState, pipeline_id : Int) -> Array[DrawTrianglesCommand]fn build_profiler_hud(cmds : Array[DrawTrianglesCommand], dst : ImageHandle, shader : ShaderHandle, profile : FrameProfile, screen_w : Double, screen_h : Double) -> Unitfn decode_triangle_payload(vertex_data : Array[Double], indices : Array[Int], uniform_dwords : Array[Int], src_image_ids : Array[Int]) -> TrianglePayloadfn draw_dot_text(cmds : Array[DrawTrianglesCommand], dst : ImageHandle, shader : ShaderHandle, chars : Array[Int], cx : Double, cy : Double, sw : Double, sh : Double, color : Color, scale : Double) -> Unitfn draw_number(cmds : Array[DrawTrianglesCommand], dst : ImageHandle, shader : ShaderHandle, number : Int, ox : Double, oy : Double, sw : Double, sh : Double, color : Color, scale : Double) -> Unitfn new_atlas_quad_batch_draw_command(dst : ImageHandle, shader : ShaderHandle, dst_region : DstRegion, pipeline_id : Int, uniform_hash : Int, blend : BlendMode, source : AtlasDrawSource, rects : Array[Double], uniform_dwords : Array[Int]) -> DrawTrianglesCommandfn new_atlas_quad_draw_command(dst : ImageHandle, shader : ShaderHandle, dst_region : DstRegion, index_offset : Int, pipeline_id : Int, uniform_hash : Int, blend : BlendMode, source : AtlasDrawSource, left : Double, top : Double, right : Double, bottom : Double, uniform_dwords : Array[Int]) -> DrawTrianglesCommandfn new_line_command(dst : ImageHandle, shader : ShaderHandle, x0 : Double, y0 : Double, x1 : Double, y1 : Double, width : Double, color : Color, pipeline_id : Int) -> DrawTrianglesCommandfn new_ndc_rect_fill_command(dst : ImageHandle, shader : ShaderHandle, px : Double, py : Double, pw : Double, ph : Double, screen_w : Double, screen_h : Double, color : Color, pipeline_id : Int) -> DrawTrianglesCommandfn new_rect_fill_command(dst : ImageHandle, shader : ShaderHandle, x : Double, y : Double, w : Double, h : Double, color : Color, pipeline_id : Int) -> DrawTrianglesCommandfn new_simple_draw_command(dst : ImageHandle, shader : ShaderHandle, vertices : Array[Double], indices : Array[Int], color : Color) -> DrawTrianglesCommandfn render_atlas_quads(frame : RenderFrame2D, quads : Array[AtlasQuad2D]) -> Array[DrawTrianglesCommand]fn[T : GraphicsDriver] render_commands(graphics : T, cmds : Array[DrawTrianglesCommand], clear_color? : Color, clear_enabled? : Bool) -> Unit raiseComprehensive 2D rendering toolkit: batched-quad RenderFrame, atlas quad geometry, color helpers, debug overlay/profiler, color-matrix transforms.
Dependencies