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 you 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



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

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

Instance Method Details

#_CalcCircleAutoSegmentCount(radius) ⇒ Object



1395
1396
1397
# File 'lib/imgui.rb', line 1395

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

#_ClearFreeMemoryObject



1399
1400
1401
# File 'lib/imgui.rb', line 1399

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

#_OnChangedClipRectObject



1403
1404
1405
# File 'lib/imgui.rb', line 1403

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

#_OnChangedTextureIDObject



1407
1408
1409
# File 'lib/imgui.rb', line 1407

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

#_OnChangedVtxOffsetObject



1411
1412
1413
# File 'lib/imgui.rb', line 1411

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

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



1415
1416
1417
# File 'lib/imgui.rb', line 1415

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



1419
1420
1421
# File 'lib/imgui.rb', line 1419

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

#_PopUnusedDrawCmdObject



1423
1424
1425
# File 'lib/imgui.rb', line 1423

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

#_ResetForNewFrameObject



1427
1428
1429
# File 'lib/imgui.rb', line 1427

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

#_SetTextureID(texture_id) ⇒ Object



1431
1432
1433
# File 'lib/imgui.rb', line 1431

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

#_TryMergeDrawCmdsObject



1435
1436
1437
# File 'lib/imgui.rb', line 1435

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

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



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

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



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

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

#AddCallback(callback, userdata, userdata_size = 0) ⇒ Object



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

def AddCallback(callback, userdata, userdata_size = 0)
  ImGui::ImDrawList_AddCallback(self, callback, userdata, userdata_size)
end

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



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

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



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

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

#AddConcavePolyFilled(points, num_points, col) ⇒ Object



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

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

#AddConvexPolyFilled(points, num_points, col) ⇒ Object



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

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

#AddDrawCmdObject



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

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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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

#ChannelsMergeObject



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

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

#ChannelsSetCurrent(n) ⇒ Object



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

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

#ChannelsSplit(count) ⇒ Object



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

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

#CloneOutputObject



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

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

#destroyObject



1439
1440
1441
# File 'lib/imgui.rb', line 1439

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

#GetClipRectMaxObject



1279
1280
1281
1282
1283
# File 'lib/imgui.rb', line 1279

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

#GetClipRectMinObject



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

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

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



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

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



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

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



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

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



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

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

#PathClearObject



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

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

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



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

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



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

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

#PathFillConvex(col) ⇒ Object



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

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

#PathLineTo(pos) ⇒ Object



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

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

#PathLineToMergeDuplicate(pos) ⇒ Object



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

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

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



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

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



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

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

#PopClipRectObject



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

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

#PopTextureIDObject



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

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

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



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

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



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

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

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



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

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



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

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

#PrimUnreserve(idx_count, vtx_count) ⇒ Object



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

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

#PrimVtx(pos, uv, col) ⇒ Object



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

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

#PrimWriteIdx(idx) ⇒ Object



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

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

#PrimWriteVtx(pos, uv, col) ⇒ Object



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

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



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

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



1387
1388
1389
# File 'lib/imgui.rb', line 1387

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

#PushTextureID(texture_id) ⇒ Object



1391
1392
1393
# File 'lib/imgui.rb', line 1391

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