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



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

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

Instance Method Details

#_CalcCircleAutoSegmentCount(radius) ⇒ Object



1338
1339
1340
# File 'lib/imgui.rb', line 1338

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

#_ClearFreeMemoryObject



1342
1343
1344
# File 'lib/imgui.rb', line 1342

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

#_OnChangedClipRectObject



1346
1347
1348
# File 'lib/imgui.rb', line 1346

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

#_OnChangedTextureIDObject



1350
1351
1352
# File 'lib/imgui.rb', line 1350

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

#_OnChangedVtxOffsetObject



1354
1355
1356
# File 'lib/imgui.rb', line 1354

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

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



1358
1359
1360
# File 'lib/imgui.rb', line 1358

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



1362
1363
1364
# File 'lib/imgui.rb', line 1362

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

#_PopUnusedDrawCmdObject



1366
1367
1368
# File 'lib/imgui.rb', line 1366

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

#_ResetForNewFrameObject



1370
1371
1372
# File 'lib/imgui.rb', line 1370

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

#_SetTextureID(texture_id) ⇒ Object



1374
1375
1376
# File 'lib/imgui.rb', line 1374

def _SetTextureID(texture_id)
  ImGui::ImDrawList__SetTextureID(self, texture_id)
end

#_TryMergeDrawCmdsObject



1378
1379
1380
# File 'lib/imgui.rb', line 1378

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

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



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

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



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

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



1110
1111
1112
# File 'lib/imgui.rb', line 1110

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

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



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

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



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

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

#AddConcavePolyFilled(points, num_points, col) ⇒ Object



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

def AddConcavePolyFilled(points, num_points, col)
  ImGui::ImDrawList_AddConcavePolyFilled(self, points, num_points, col)
end

#AddConvexPolyFilled(points, num_points, col) ⇒ Object



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

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

#AddDrawCmdObject



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

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

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



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

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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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

#ChannelsMergeObject



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

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

#ChannelsSetCurrent(n) ⇒ Object



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

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

#ChannelsSplit(count) ⇒ Object



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

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

#CloneOutputObject



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

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

#destroyObject



1382
1383
1384
# File 'lib/imgui.rb', line 1382

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

#GetClipRectMaxObject



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

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

#GetClipRectMinObject



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

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

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



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

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



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

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



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

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



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

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

#PathClearObject



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

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

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



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

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

#PathFillConcave(col) ⇒ Object



1262
1263
1264
# File 'lib/imgui.rb', line 1262

def PathFillConcave(col)
  ImGui::ImDrawList_PathFillConcave(self, col)
end

#PathFillConvex(col) ⇒ Object



1266
1267
1268
# File 'lib/imgui.rb', line 1266

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

#PathLineTo(pos) ⇒ Object



1270
1271
1272
# File 'lib/imgui.rb', line 1270

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

#PathLineToMergeDuplicate(pos) ⇒ Object



1274
1275
1276
# File 'lib/imgui.rb', line 1274

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

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



1278
1279
1280
# File 'lib/imgui.rb', line 1278

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



1282
1283
1284
# File 'lib/imgui.rb', line 1282

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

#PopClipRectObject



1286
1287
1288
# File 'lib/imgui.rb', line 1286

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

#PopTextureIDObject



1290
1291
1292
# File 'lib/imgui.rb', line 1290

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

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



1294
1295
1296
# File 'lib/imgui.rb', line 1294

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



1298
1299
1300
# File 'lib/imgui.rb', line 1298

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

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



1302
1303
1304
# File 'lib/imgui.rb', line 1302

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



1306
1307
1308
# File 'lib/imgui.rb', line 1306

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

#PrimUnreserve(idx_count, vtx_count) ⇒ Object



1310
1311
1312
# File 'lib/imgui.rb', line 1310

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

#PrimVtx(pos, uv, col) ⇒ Object



1314
1315
1316
# File 'lib/imgui.rb', line 1314

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

#PrimWriteIdx(idx) ⇒ Object



1318
1319
1320
# File 'lib/imgui.rb', line 1318

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

#PrimWriteVtx(pos, uv, col) ⇒ Object



1322
1323
1324
# File 'lib/imgui.rb', line 1322

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



1326
1327
1328
# File 'lib/imgui.rb', line 1326

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



1330
1331
1332
# File 'lib/imgui.rb', line 1330

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

#PushTextureID(texture_id) ⇒ Object



1334
1335
1336
# File 'lib/imgui.rb', line 1334

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