struct ImGui::ImDrawList

Overview

struct ImDrawList

Included Modules

Defined in:

imgui.cr
obj.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(shared_data : ImDrawListSharedData) : ImDrawList #

[View source]

Instance Method Detail

def add_bezier_cubic(p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, p4 : ImVec2, col : UInt32, thickness : Float32, num_segments : Int32 = 0) : Void #

Cubic Bezier (4 control points)

ImDrawList::AddBezierCubic()


[View source]
def add_bezier_quadratic(p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, col : UInt32, thickness : Float32, num_segments : Int32 = 0) : Void #

Quadratic Bezier (3 control points)

ImDrawList::AddBezierQuadratic()


[View source]
def add_callback(callback : ImDrawCallback, callback_data : Pointer(Void)) : Void #

Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.

ImDrawList::AddCallback()


[View source]
def add_callback(&block : ImDrawList, ImDrawCmd -> ) : Void #

[View source]
def add_circle(center : ImVec2, radius : Float32, col : UInt32, num_segments : Int32 = 0, thickness : Float32 = 1.0) : Void #

[View source]
def add_circle_filled(center : ImVec2, radius : Float32, col : UInt32, num_segments : Int32 = 0) : Void #

[View source]
def add_concave_poly_filled(points : Pointer(ImVec2), num_points : Int32, col : UInt32) : Void #

[View source]
def add_convex_poly_filled(points : Pointer(ImVec2), num_points : Int32, col : UInt32) : Void #

[View source]
def add_draw_cmd : Void #

This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible

ImDrawList::AddDrawCmd()


[View source]
def add_ellipse(center : ImVec2, radius : ImVec2, col : UInt32, rot : Float32 = 0.0, num_segments : Int32 = 0, thickness : Float32 = 1.0) : Void #

[View source]
def add_ellipse_filled(center : ImVec2, radius : ImVec2, col : UInt32, rot : Float32 = 0.0, num_segments : Int32 = 0) : Void #

[View source]
def add_image(user_texture_id : ImTextureID, p_min : ImVec2, p_max : ImVec2, uv_min : ImVec2 = ImVec2.new(0, 0), uv_max : ImVec2 = ImVec2.new(1, 1), col : UInt32 = 4294967295_i64) : Void #

[View source]
def add_image_quad(user_texture_id : ImTextureID, p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, p4 : ImVec2, uv1 : ImVec2 = ImVec2.new(0, 0), uv2 : ImVec2 = ImVec2.new(1, 0), uv3 : ImVec2 = ImVec2.new(1, 1), uv4 : ImVec2 = ImVec2.new(0, 1), col : UInt32 = 4294967295_i64) : Void #

[View source]
def add_image_rounded(user_texture_id : ImTextureID, p_min : ImVec2, p_max : ImVec2, uv_min : ImVec2, uv_max : ImVec2, col : UInt32, rounding : Float32, flags : ImDrawFlags = ImDrawFlags.new(0)) : Void #

[View source]
def add_line(p1 : ImVec2, p2 : ImVec2, col : UInt32, thickness : Float32 = 1.0) : Void #

[View source]
def add_ngon(center : ImVec2, radius : Float32, col : UInt32, num_segments : Int32, thickness : Float32 = 1.0) : Void #

[View source]
def add_ngon_filled(center : ImVec2, radius : Float32, col : UInt32, num_segments : Int32) : Void #

[View source]
def add_polyline(points : Pointer(ImVec2), num_points : Int32, col : UInt32, flags : ImDrawFlags, thickness : Float32) : Void #

[View source]
def add_quad(p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, p4 : ImVec2, col : UInt32, thickness : Float32 = 1.0) : Void #

[View source]
def add_quad_filled(p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, p4 : ImVec2, col : UInt32) : Void #

[View source]
def add_rect(p_min : ImVec2, p_max : ImVec2, col : UInt32, rounding : Float32 = 0.0, flags : ImDrawFlags = ImDrawFlags.new(0), thickness : Float32 = 1.0) : Void #

a: upper-left, b: lower-right (== upper-left + size)

ImDrawList::AddRect()


[View source]
def add_rect_filled(p_min : ImVec2, p_max : ImVec2, col : UInt32, rounding : Float32 = 0.0, flags : ImDrawFlags = ImDrawFlags.new(0)) : Void #

a: upper-left, b: lower-right (== upper-left + size)

ImDrawList::AddRectFilled()


[View source]
def add_rect_filled_multi_color(p_min : ImVec2, p_max : ImVec2, col_upr_left : UInt32, col_upr_right : UInt32, col_bot_right : UInt32, col_bot_left : UInt32) : Void #

[View source]
def add_text(font : ImFont, font_size : Float32, pos : ImVec2, col : UInt32, text : Bytes | String, wrap_width : Float32 = 0.0, cpu_fine_clip_rect : Pointer(ImVec4) = Pointer(ImVec4).null) : Void #

[View source]
def add_text(pos : ImVec2, col : UInt32, text : Bytes | String) : Void #

[View source]
def add_triangle(p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, col : UInt32, thickness : Float32 = 1.0) : Void #

[View source]
def add_triangle_filled(p1 : ImVec2, p2 : ImVec2, p3 : ImVec2, col : UInt32) : Void #

[View source]
def channels_merge : Void #

[View source]
def channels_set_current(n : Int32) : Void #

[View source]
def channels_split(count : Int32) : Void #

[View source]
def clone_output : ImDrawList #

Create a clone of the CmdBuffer/IdxBuffer/VtxBuffer.

ImDrawList::CloneOutput()


[View source]
def cmd_buffer : ImVector(LibImGui::ImDrawCmd) #

Draw commands. Typically 1 command = 1 GPU draw call, unless the command is a callback.


[View source]
def cmd_buffer=(cmd_buffer : ImVector(LibImGui::ImDrawCmd)) #

[View source]
def flags : ImDrawListFlags #

Flags, you may poke into these to adjust anti-aliasing settings per-primitive.


[View source]
def flags=(flags : ImDrawListFlags) #

[View source]
def get_clip_rect_max : ImGui::ImVec2 #

[View source]
def get_clip_rect_min : ImGui::ImVec2 #

[View source]
def idx_buffer : ImVector(ImDrawIdx) #

Index buffer. Each command consume ImDrawCmd::ElemCount of those


[View source]
def idx_buffer=(idx_buffer : ImVector(ImDrawIdx)) #

[View source]
def path_arc_to(center : ImVec2, radius : Float32, a_min : Float32, a_max : Float32, num_segments : Int32 = 0) : Void #

[View source]
def path_arc_to_fast(center : ImVec2, radius : Float32, a_min_of_12 : Int32, a_max_of_12 : Int32) : Void #

Use precomputed angles for a 12 steps circle

ImDrawList::PathArcToFast()


[View source]
def path_bezier_cubic_curve_to(p2 : ImVec2, p3 : ImVec2, p4 : ImVec2, num_segments : Int32 = 0) : Void #

Cubic Bezier (4 control points)

ImDrawList::PathBezierCubicCurveTo()


[View source]
def path_bezier_quadratic_curve_to(p2 : ImVec2, p3 : ImVec2, num_segments : Int32 = 0) : Void #

Quadratic Bezier (3 control points)

ImDrawList::PathBezierQuadraticCurveTo()


[View source]
def path_clear : Void #

[View source]
def path_elliptical_arc_to(center : ImVec2, radius : ImVec2, rot : Float32, a_min : Float32, a_max : Float32, num_segments : Int32 = 0) : Void #

[View source]
def path_fill_concave(col : UInt32) : Void #

[View source]
def path_fill_convex(col : UInt32) : Void #

[View source]
def path_line_to(pos : ImVec2) : Void #

[View source]
def path_line_to_merge_duplicate(pos : ImVec2) : Void #

[View source]
def path_rect(rect_min : ImVec2, rect_max : ImVec2, rounding : Float32 = 0.0, flags : ImDrawFlags = ImDrawFlags.new(0)) : Void #

[View source]
def path_stroke(col : UInt32, flags : ImDrawFlags = ImDrawFlags.new(0), thickness : Float32 = 1.0) : Void #

[View source]
def pop_clip_rect : Void #

[View source]
def pop_texture_id : Void #

[View source]
def prim_quad_uv(a : ImVec2, b : ImVec2, c : ImVec2, d : ImVec2, uv_a : ImVec2, uv_b : ImVec2, uv_c : ImVec2, uv_d : ImVec2, col : UInt32) : Void #

[View source]
def prim_rect(a : ImVec2, b : ImVec2, col : UInt32) : Void #

Axis aligned rectangle (composed of two triangles)

ImDrawList::PrimRect()


[View source]
def prim_rect_uv(a : ImVec2, b : ImVec2, uv_a : ImVec2, uv_b : ImVec2, col : UInt32) : Void #

[View source]
def prim_reserve(idx_count : Int32, vtx_count : Int32) : Void #

[View source]
def prim_unreserve(idx_count : Int32, vtx_count : Int32) : Void #

[View source]
def prim_vtx(pos : ImVec2, uv : ImVec2, col : UInt32) : Void #

Write vertex with unique index

ImDrawList::PrimVtx()


[View source]
def prim_write_idx(idx : ImDrawIdx) : Void #

[View source]
def prim_write_vtx(pos : ImVec2, uv : ImVec2, col : UInt32) : Void #

[View source]
def push_clip_rect(clip_rect_min : ImVec2, clip_rect_max : ImVec2, intersect_with_current_clip_rect : Bool = false) : Void #

Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)

ImDrawList::PushClipRect()


[View source]
def push_clip_rect_full_screen : Void #

[View source]
def push_texture_id(texture_id : ImTextureID) : Void #

[View source]
def to_unsafe : Pointer(T) #

[View source]
def vtx_buffer : ImVector(ImDrawVert) #

Vertex buffer.


[View source]
def vtx_buffer=(vtx_buffer : ImVector(ImDrawVert)) #

[View source]