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



1118
1119
1120
# File 'lib/imgui.rb', line 1118

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

Instance Method Details

#_CalcCircleAutoSegmentCount(radius) ⇒ Object



1218
1219
1220
# File 'lib/imgui.rb', line 1218

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

#_ClearFreeMemoryObject



1222
1223
1224
# File 'lib/imgui.rb', line 1222

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

#_OnChangedClipRectObject



1226
1227
1228
# File 'lib/imgui.rb', line 1226

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

#_OnChangedTextureIDObject



1230
1231
1232
# File 'lib/imgui.rb', line 1230

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

#_OnChangedVtxOffsetObject



1234
1235
1236
# File 'lib/imgui.rb', line 1234

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

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



1238
1239
1240
# File 'lib/imgui.rb', line 1238

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



1242
1243
1244
# File 'lib/imgui.rb', line 1242

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

#_PopUnusedDrawCmdObject



1246
1247
1248
# File 'lib/imgui.rb', line 1246

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

#_ResetForNewFrameObject



1250
1251
1252
# File 'lib/imgui.rb', line 1250

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

#_TryMergeDrawCmdsObject



1254
1255
1256
# File 'lib/imgui.rb', line 1254

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

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



990
991
992
# File 'lib/imgui.rb', line 990

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



994
995
996
# File 'lib/imgui.rb', line 994

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



998
999
1000
# File 'lib/imgui.rb', line 998

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

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



1002
1003
1004
# File 'lib/imgui.rb', line 1002

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



1006
1007
1008
# File 'lib/imgui.rb', line 1006

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

#AddConvexPolyFilled(points, num_points, col) ⇒ Object



1010
1011
1012
# File 'lib/imgui.rb', line 1010

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

#AddDrawCmdObject



1014
1015
1016
# File 'lib/imgui.rb', line 1014

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

#AddEllipse(center, radius_x, radius_y, col, rot = 0.0, num_segments = 0, thickness = 1.0) ⇒ Object



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

def AddEllipse(center, radius_x, radius_y, col, rot = 0.0, num_segments = 0, thickness = 1.0)
  ImGui::ImDrawList_AddEllipse(self, center, radius_x, radius_y, col, rot, num_segments, thickness)
end

#AddEllipseFilled(center, radius_x, radius_y, col, rot = 0.0, num_segments = 0) ⇒ Object



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

def AddEllipseFilled(center, radius_x, radius_y, col, rot = 0.0, num_segments = 0)
  ImGui::ImDrawList_AddEllipseFilled(self, center, radius_x, radius_y, col, rot, num_segments)
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



1026
1027
1028
# File 'lib/imgui.rb', line 1026

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



1030
1031
1032
# File 'lib/imgui.rb', line 1030

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



1034
1035
1036
# File 'lib/imgui.rb', line 1034

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



1038
1039
1040
# File 'lib/imgui.rb', line 1038

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



1042
1043
1044
# File 'lib/imgui.rb', line 1042

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



1046
1047
1048
# File 'lib/imgui.rb', line 1046

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



1050
1051
1052
# File 'lib/imgui.rb', line 1050

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



1054
1055
1056
# File 'lib/imgui.rb', line 1054

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



1058
1059
1060
# File 'lib/imgui.rb', line 1058

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



1062
1063
1064
# File 'lib/imgui.rb', line 1062

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



1066
1067
1068
# File 'lib/imgui.rb', line 1066

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



1070
1071
1072
# File 'lib/imgui.rb', line 1070

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



1078
1079
1080
# File 'lib/imgui.rb', line 1078

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



1074
1075
1076
# File 'lib/imgui.rb', line 1074

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



1082
1083
1084
# File 'lib/imgui.rb', line 1082

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



1086
1087
1088
# File 'lib/imgui.rb', line 1086

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

#ChannelsMergeObject



1090
1091
1092
# File 'lib/imgui.rb', line 1090

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

#ChannelsSetCurrent(n) ⇒ Object



1094
1095
1096
# File 'lib/imgui.rb', line 1094

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

#ChannelsSplit(count) ⇒ Object



1098
1099
1100
# File 'lib/imgui.rb', line 1098

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

#CloneOutputObject



1102
1103
1104
# File 'lib/imgui.rb', line 1102

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

#destroyObject



1258
1259
1260
# File 'lib/imgui.rb', line 1258

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

#GetClipRectMaxObject



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

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

#GetClipRectMinObject



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

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

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



1122
1123
1124
# File 'lib/imgui.rb', line 1122

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



1126
1127
1128
# File 'lib/imgui.rb', line 1126

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



1130
1131
1132
# File 'lib/imgui.rb', line 1130

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



1134
1135
1136
# File 'lib/imgui.rb', line 1134

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

#PathClearObject



1138
1139
1140
# File 'lib/imgui.rb', line 1138

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

#PathEllipticalArcTo(center, radius_x, radius_y, rot, a_min, a_max, num_segments = 0) ⇒ Object



1142
1143
1144
# File 'lib/imgui.rb', line 1142

def PathEllipticalArcTo(center, radius_x, radius_y, rot, a_min, a_max, num_segments = 0)
  ImGui::ImDrawList_PathEllipticalArcTo(self, center, radius_x, radius_y, rot, a_min, a_max, num_segments)
end

#PathFillConvex(col) ⇒ Object



1146
1147
1148
# File 'lib/imgui.rb', line 1146

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

#PathLineTo(pos) ⇒ Object



1150
1151
1152
# File 'lib/imgui.rb', line 1150

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

#PathLineToMergeDuplicate(pos) ⇒ Object



1154
1155
1156
# File 'lib/imgui.rb', line 1154

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

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



1158
1159
1160
# File 'lib/imgui.rb', line 1158

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



1162
1163
1164
# File 'lib/imgui.rb', line 1162

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

#PopClipRectObject



1166
1167
1168
# File 'lib/imgui.rb', line 1166

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

#PopTextureIDObject



1170
1171
1172
# File 'lib/imgui.rb', line 1170

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

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



1174
1175
1176
# File 'lib/imgui.rb', line 1174

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



1178
1179
1180
# File 'lib/imgui.rb', line 1178

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

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



1182
1183
1184
# File 'lib/imgui.rb', line 1182

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



1186
1187
1188
# File 'lib/imgui.rb', line 1186

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

#PrimUnreserve(idx_count, vtx_count) ⇒ Object



1190
1191
1192
# File 'lib/imgui.rb', line 1190

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

#PrimVtx(pos, uv, col) ⇒ Object



1194
1195
1196
# File 'lib/imgui.rb', line 1194

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

#PrimWriteIdx(idx) ⇒ Object



1198
1199
1200
# File 'lib/imgui.rb', line 1198

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

#PrimWriteVtx(pos, uv, col) ⇒ Object



1202
1203
1204
# File 'lib/imgui.rb', line 1202

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



1206
1207
1208
# File 'lib/imgui.rb', line 1206

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



1210
1211
1212
# File 'lib/imgui.rb', line 1210

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

#PushTextureID(texture_id) ⇒ Object



1214
1215
1216
# File 'lib/imgui.rb', line 1214

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