Class: ImDrawList

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/imgui.rb

Overview

Draw command list

This is the low-level list of polygons that ImGui

functions are filling. At the end of the frame,

all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering. Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to access the current window draw list and draw custom primitives.

You can interleave normal ImGui

calls and adding primitives to the current draw list.

In single viewport mode, top-left is == GetMainViewport()->Pos (generally 0,0), bottom-right is == GetMainViewport()->Pos+Size (generally io.DisplaySize). You are totally free to apply whatever transformation matrix to want to the data (depending on the use of the transformation you may want to apply it to ClipRect as well!)

Important: Primitives are always added to the list and not culled (culling is done at higher-level by ImGui

functions), if you use this API a lot consider coarse culling your drawn objects.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.create(shared_data) ⇒ Object



1028
1029
1030
# File 'lib/imgui.rb', line 1028

def self.create(shared_data)
  return ImDrawList.new(ImGui::ImDrawList_ImDrawList(shared_data))
end

Instance Method Details

#_CalcCircleAutoSegmentCount(radius) ⇒ Object



1124
1125
1126
# File 'lib/imgui.rb', line 1124

def _CalcCircleAutoSegmentCount(radius)
  ImGui::ImDrawList__CalcCircleAutoSegmentCount(self, radius)
end

#_ClearFreeMemoryObject



1128
1129
1130
# File 'lib/imgui.rb', line 1128

def _ClearFreeMemory()
  ImGui::ImDrawList__ClearFreeMemory(self)
end

#_OnChangedClipRectObject



1132
1133
1134
# File 'lib/imgui.rb', line 1132

def _OnChangedClipRect()
  ImGui::ImDrawList__OnChangedClipRect(self)
end

#_OnChangedTextureIDObject



1136
1137
1138
# File 'lib/imgui.rb', line 1136

def _OnChangedTextureID()
  ImGui::ImDrawList__OnChangedTextureID(self)
end

#_OnChangedVtxOffsetObject



1140
1141
1142
# File 'lib/imgui.rb', line 1140

def _OnChangedVtxOffset()
  ImGui::ImDrawList__OnChangedVtxOffset(self)
end

#_PathArcToFastEx(center, radius, a_min_sample, a_max_sample, a_step) ⇒ Object



1144
1145
1146
# File 'lib/imgui.rb', line 1144

def _PathArcToFastEx(center, radius, a_min_sample, a_max_sample, a_step)
  ImGui::ImDrawList__PathArcToFastEx(self, center, radius, a_min_sample, a_max_sample, a_step)
end

#_PathArcToN(center, radius, a_min, a_max, num_segments) ⇒ Object



1148
1149
1150
# File 'lib/imgui.rb', line 1148

def _PathArcToN(center, radius, a_min, a_max, num_segments)
  ImGui::ImDrawList__PathArcToN(self, center, radius, a_min, a_max, num_segments)
end

#_PopUnusedDrawCmdObject



1152
1153
1154
# File 'lib/imgui.rb', line 1152

def _PopUnusedDrawCmd()
  ImGui::ImDrawList__PopUnusedDrawCmd(self)
end

#_ResetForNewFrameObject



1156
1157
1158
# File 'lib/imgui.rb', line 1156

def _ResetForNewFrame()
  ImGui::ImDrawList__ResetForNewFrame(self)
end

#_TryMergeDrawCmdsObject



1160
1161
1162
# File 'lib/imgui.rb', line 1160

def _TryMergeDrawCmds()
  ImGui::ImDrawList__TryMergeDrawCmds(self)
end

#AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments = 0) ⇒ Object



908
909
910
# File 'lib/imgui.rb', line 908

def AddBezierCubic(p1, p2, p3, p4, col, thickness, num_segments = 0)
  ImGui::ImDrawList_AddBezierCubic(self, p1, p2, p3, p4, col, thickness, num_segments)
end

#AddBezierQuadratic(p1, p2, p3, col, thickness, num_segments = 0) ⇒ Object



912
913
914
# File 'lib/imgui.rb', line 912

def AddBezierQuadratic(p1, p2, p3, col, thickness, num_segments = 0)
  ImGui::ImDrawList_AddBezierQuadratic(self, p1, p2, p3, col, thickness, num_segments)
end

#AddCallback(callback, callback_data) ⇒ Object



916
917
918
# File 'lib/imgui.rb', line 916

def AddCallback(callback, callback_data)
  ImGui::ImDrawList_AddCallback(self, callback, callback_data)
end

#AddCircle(center, radius, col, num_segments = 0, thickness = 1.0) ⇒ Object



920
921
922
# File 'lib/imgui.rb', line 920

def AddCircle(center, radius, col, num_segments = 0, thickness = 1.0)
  ImGui::ImDrawList_AddCircle(self, center, radius, col, num_segments, thickness)
end

#AddCircleFilled(center, radius, col, num_segments = 0) ⇒ Object



924
925
926
# File 'lib/imgui.rb', line 924

def AddCircleFilled(center, radius, col, num_segments = 0)
  ImGui::ImDrawList_AddCircleFilled(self, center, radius, col, num_segments)
end

#AddConvexPolyFilled(points, num_points, col) ⇒ Object



928
929
930
# File 'lib/imgui.rb', line 928

def AddConvexPolyFilled(points, num_points, col)
  ImGui::ImDrawList_AddConvexPolyFilled(self, points, num_points, col)
end

#AddDrawCmdObject



932
933
934
# File 'lib/imgui.rb', line 932

def AddDrawCmd()
  ImGui::ImDrawList_AddDrawCmd(self)
end

#AddImage(user_texture_id, p_min, p_max, uv_min = ImVec2.create(0,0), uv_max = ImVec2.create(1,1), col = ImColor.col32(255,255,255,255)) ⇒ Object



936
937
938
# File 'lib/imgui.rb', line 936

def AddImage(user_texture_id, p_min, p_max, uv_min = ImVec2.create(0,0), uv_max = ImVec2.create(1,1), col = ImColor.col32(255,255,255,255))
  ImGui::ImDrawList_AddImage(self, user_texture_id, p_min, p_max, uv_min, uv_max, col)
end

#AddImageQuad(user_texture_id, p1, p2, p3, p4, uv1 = ImVec2.create(0,0), uv2 = ImVec2.create(1,0), uv3 = ImVec2.create(1,1), uv4 = ImVec2.create(0,1), col = ImColor.col32(255,255,255,255)) ⇒ Object



940
941
942
# File 'lib/imgui.rb', line 940

def AddImageQuad(user_texture_id, p1, p2, p3, p4, uv1 = ImVec2.create(0,0), uv2 = ImVec2.create(1,0), uv3 = ImVec2.create(1,1), uv4 = ImVec2.create(0,1), col = ImColor.col32(255,255,255,255))
  ImGui::ImDrawList_AddImageQuad(self, user_texture_id, p1, p2, p3, p4, uv1, uv2, uv3, uv4, col)
end

#AddImageRounded(user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags = 0) ⇒ Object



944
945
946
# File 'lib/imgui.rb', line 944

def AddImageRounded(user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags = 0)
  ImGui::ImDrawList_AddImageRounded(self, user_texture_id, p_min, p_max, uv_min, uv_max, col, rounding, flags)
end

#AddLine(p1, p2, col, thickness = 1.0) ⇒ Object



948
949
950
# File 'lib/imgui.rb', line 948

def AddLine(p1, p2, col, thickness = 1.0)
  ImGui::ImDrawList_AddLine(self, p1, p2, col, thickness)
end

#AddNgon(center, radius, col, num_segments, thickness = 1.0) ⇒ Object



952
953
954
# File 'lib/imgui.rb', line 952

def AddNgon(center, radius, col, num_segments, thickness = 1.0)
  ImGui::ImDrawList_AddNgon(self, center, radius, col, num_segments, thickness)
end

#AddNgonFilled(center, radius, col, num_segments) ⇒ Object



956
957
958
# File 'lib/imgui.rb', line 956

def AddNgonFilled(center, radius, col, num_segments)
  ImGui::ImDrawList_AddNgonFilled(self, center, radius, col, num_segments)
end

#AddPolyline(points, num_points, col, flags, thickness) ⇒ Object



960
961
962
# File 'lib/imgui.rb', line 960

def AddPolyline(points, num_points, col, flags, thickness)
  ImGui::ImDrawList_AddPolyline(self, points, num_points, col, flags, thickness)
end

#AddQuad(p1, p2, p3, p4, col, thickness = 1.0) ⇒ Object



964
965
966
# File 'lib/imgui.rb', line 964

def AddQuad(p1, p2, p3, p4, col, thickness = 1.0)
  ImGui::ImDrawList_AddQuad(self, p1, p2, p3, p4, col, thickness)
end

#AddQuadFilled(p1, p2, p3, p4, col) ⇒ Object



968
969
970
# File 'lib/imgui.rb', line 968

def AddQuadFilled(p1, p2, p3, p4, col)
  ImGui::ImDrawList_AddQuadFilled(self, p1, p2, p3, p4, col)
end

#AddRect(p_min, p_max, col, rounding = 0.0, flags = 0, thickness = 1.0) ⇒ Object



972
973
974
# File 'lib/imgui.rb', line 972

def AddRect(p_min, p_max, col, rounding = 0.0, flags = 0, thickness = 1.0)
  ImGui::ImDrawList_AddRect(self, p_min, p_max, col, rounding, flags, thickness)
end

#AddRectFilled(p_min, p_max, col, rounding = 0.0, flags = 0) ⇒ Object



976
977
978
# File 'lib/imgui.rb', line 976

def AddRectFilled(p_min, p_max, col, rounding = 0.0, flags = 0)
  ImGui::ImDrawList_AddRectFilled(self, p_min, p_max, col, rounding, flags)
end

#AddRectFilledMultiColor(p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left) ⇒ Object



980
981
982
# File 'lib/imgui.rb', line 980

def AddRectFilledMultiColor(p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left)
  ImGui::ImDrawList_AddRectFilledMultiColor(self, p_min, p_max, col_upr_left, col_upr_right, col_bot_right, col_bot_left)
end

#AddText_FontPtr(font, font_size, pos, col, text_begin, text_end = nil, wrap_width = 0.0, cpu_fine_clip_rect = nil) ⇒ Object



988
989
990
# File 'lib/imgui.rb', line 988

def AddText_FontPtr(font, font_size, pos, col, text_begin, text_end = nil, wrap_width = 0.0, cpu_fine_clip_rect = nil)
  ImGui::ImDrawList_AddText_FontPtr(self, font, font_size, pos, col, text_begin, text_end, wrap_width, cpu_fine_clip_rect)
end

#AddText_Vec2(pos, col, text_begin, text_end = nil) ⇒ Object



984
985
986
# File 'lib/imgui.rb', line 984

def AddText_Vec2(pos, col, text_begin, text_end = nil)
  ImGui::ImDrawList_AddText_Vec2(self, pos, col, text_begin, text_end)
end

#AddTriangle(p1, p2, p3, col, thickness = 1.0) ⇒ Object



992
993
994
# File 'lib/imgui.rb', line 992

def AddTriangle(p1, p2, p3, col, thickness = 1.0)
  ImGui::ImDrawList_AddTriangle(self, p1, p2, p3, col, thickness)
end

#AddTriangleFilled(p1, p2, p3, col) ⇒ Object



996
997
998
# File 'lib/imgui.rb', line 996

def AddTriangleFilled(p1, p2, p3, col)
  ImGui::ImDrawList_AddTriangleFilled(self, p1, p2, p3, col)
end

#ChannelsMergeObject



1000
1001
1002
# File 'lib/imgui.rb', line 1000

def ChannelsMerge()
  ImGui::ImDrawList_ChannelsMerge(self)
end

#ChannelsSetCurrent(n) ⇒ Object



1004
1005
1006
# File 'lib/imgui.rb', line 1004

def ChannelsSetCurrent(n)
  ImGui::ImDrawList_ChannelsSetCurrent(self, n)
end

#ChannelsSplit(count) ⇒ Object



1008
1009
1010
# File 'lib/imgui.rb', line 1008

def ChannelsSplit(count)
  ImGui::ImDrawList_ChannelsSplit(self, count)
end

#CloneOutputObject



1012
1013
1014
# File 'lib/imgui.rb', line 1012

def CloneOutput()
  ImGui::ImDrawList_CloneOutput(self)
end

#destroyObject



1164
1165
1166
# File 'lib/imgui.rb', line 1164

def destroy()
  ImGui::ImDrawList_destroy(self)
end

#GetClipRectMaxObject



1016
1017
1018
1019
1020
# File 'lib/imgui.rb', line 1016

def GetClipRectMax()
  pOut = ImVec2.new
  ImGui::ImDrawList_GetClipRectMax(pOut, self)
  return pOut
end

#GetClipRectMinObject



1022
1023
1024
1025
1026
# File 'lib/imgui.rb', line 1022

def GetClipRectMin()
  pOut = ImVec2.new
  ImGui::ImDrawList_GetClipRectMin(pOut, self)
  return pOut
end

#PathArcTo(center, radius, a_min, a_max, num_segments = 0) ⇒ Object



1032
1033
1034
# File 'lib/imgui.rb', line 1032

def PathArcTo(center, radius, a_min, a_max, num_segments = 0)
  ImGui::ImDrawList_PathArcTo(self, center, radius, a_min, a_max, num_segments)
end

#PathArcToFast(center, radius, a_min_of_12, a_max_of_12) ⇒ Object



1036
1037
1038
# File 'lib/imgui.rb', line 1036

def PathArcToFast(center, radius, a_min_of_12, a_max_of_12)
  ImGui::ImDrawList_PathArcToFast(self, center, radius, a_min_of_12, a_max_of_12)
end

#PathBezierCubicCurveTo(p2, p3, p4, num_segments = 0) ⇒ Object



1040
1041
1042
# File 'lib/imgui.rb', line 1040

def PathBezierCubicCurveTo(p2, p3, p4, num_segments = 0)
  ImGui::ImDrawList_PathBezierCubicCurveTo(self, p2, p3, p4, num_segments)
end

#PathBezierQuadraticCurveTo(p2, p3, num_segments = 0) ⇒ Object



1044
1045
1046
# File 'lib/imgui.rb', line 1044

def PathBezierQuadraticCurveTo(p2, p3, num_segments = 0)
  ImGui::ImDrawList_PathBezierQuadraticCurveTo(self, p2, p3, num_segments)
end

#PathClearObject



1048
1049
1050
# File 'lib/imgui.rb', line 1048

def PathClear()
  ImGui::ImDrawList_PathClear(self)
end

#PathFillConvex(col) ⇒ Object



1052
1053
1054
# File 'lib/imgui.rb', line 1052

def PathFillConvex(col)
  ImGui::ImDrawList_PathFillConvex(self, col)
end

#PathLineTo(pos) ⇒ Object



1056
1057
1058
# File 'lib/imgui.rb', line 1056

def PathLineTo(pos)
  ImGui::ImDrawList_PathLineTo(self, pos)
end

#PathLineToMergeDuplicate(pos) ⇒ Object



1060
1061
1062
# File 'lib/imgui.rb', line 1060

def PathLineToMergeDuplicate(pos)
  ImGui::ImDrawList_PathLineToMergeDuplicate(self, pos)
end

#PathRect(rect_min, rect_max, rounding = 0.0, flags = 0) ⇒ Object



1064
1065
1066
# File 'lib/imgui.rb', line 1064

def PathRect(rect_min, rect_max, rounding = 0.0, flags = 0)
  ImGui::ImDrawList_PathRect(self, rect_min, rect_max, rounding, flags)
end

#PathStroke(col, flags = 0, thickness = 1.0) ⇒ Object



1068
1069
1070
# File 'lib/imgui.rb', line 1068

def PathStroke(col, flags = 0, thickness = 1.0)
  ImGui::ImDrawList_PathStroke(self, col, flags, thickness)
end

#PopClipRectObject



1072
1073
1074
# File 'lib/imgui.rb', line 1072

def PopClipRect()
  ImGui::ImDrawList_PopClipRect(self)
end

#PopTextureIDObject



1076
1077
1078
# File 'lib/imgui.rb', line 1076

def PopTextureID()
  ImGui::ImDrawList_PopTextureID(self)
end

#PrimQuadUV(a, b, c, d, uv_a, uv_b, uv_c, uv_d, col) ⇒ Object



1080
1081
1082
# File 'lib/imgui.rb', line 1080

def PrimQuadUV(a, b, c, d, uv_a, uv_b, uv_c, uv_d, col)
  ImGui::ImDrawList_PrimQuadUV(self, a, b, c, d, uv_a, uv_b, uv_c, uv_d, col)
end

#PrimRect(a, b, col) ⇒ Object



1084
1085
1086
# File 'lib/imgui.rb', line 1084

def PrimRect(a, b, col)
  ImGui::ImDrawList_PrimRect(self, a, b, col)
end

#PrimRectUV(a, b, uv_a, uv_b, col) ⇒ Object



1088
1089
1090
# File 'lib/imgui.rb', line 1088

def PrimRectUV(a, b, uv_a, uv_b, col)
  ImGui::ImDrawList_PrimRectUV(self, a, b, uv_a, uv_b, col)
end

#PrimReserve(idx_count, vtx_count) ⇒ Object



1092
1093
1094
# File 'lib/imgui.rb', line 1092

def PrimReserve(idx_count, vtx_count)
  ImGui::ImDrawList_PrimReserve(self, idx_count, vtx_count)
end

#PrimUnreserve(idx_count, vtx_count) ⇒ Object



1096
1097
1098
# File 'lib/imgui.rb', line 1096

def PrimUnreserve(idx_count, vtx_count)
  ImGui::ImDrawList_PrimUnreserve(self, idx_count, vtx_count)
end

#PrimVtx(pos, uv, col) ⇒ Object



1100
1101
1102
# File 'lib/imgui.rb', line 1100

def PrimVtx(pos, uv, col)
  ImGui::ImDrawList_PrimVtx(self, pos, uv, col)
end

#PrimWriteIdx(idx) ⇒ Object



1104
1105
1106
# File 'lib/imgui.rb', line 1104

def PrimWriteIdx(idx)
  ImGui::ImDrawList_PrimWriteIdx(self, idx)
end

#PrimWriteVtx(pos, uv, col) ⇒ Object



1108
1109
1110
# File 'lib/imgui.rb', line 1108

def PrimWriteVtx(pos, uv, col)
  ImGui::ImDrawList_PrimWriteVtx(self, pos, uv, col)
end

#PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect = false) ⇒ Object



1112
1113
1114
# File 'lib/imgui.rb', line 1112

def PushClipRect(clip_rect_min, clip_rect_max, intersect_with_current_clip_rect = false)
  ImGui::ImDrawList_PushClipRect(self, clip_rect_min, clip_rect_max, intersect_with_current_clip_rect)
end

#PushClipRectFullScreenObject



1116
1117
1118
# File 'lib/imgui.rb', line 1116

def PushClipRectFullScreen()
  ImGui::ImDrawList_PushClipRectFullScreen(self)
end

#PushTextureID(texture_id) ⇒ Object



1120
1121
1122
# File 'lib/imgui.rb', line 1120

def PushTextureID(texture_id)
  ImGui::ImDrawList_PushTextureID(self, texture_id)
end