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



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

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

Instance Method Details

#_CalcCircleAutoSegmentCount(radius) ⇒ Object



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

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

#_ClearFreeMemoryObject



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

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

#_OnChangedClipRectObject



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

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

#_OnChangedTextureIDObject



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

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

#_OnChangedVtxOffsetObject



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

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

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



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

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



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

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

#_PopUnusedDrawCmdObject



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

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

#_ResetForNewFrameObject



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

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

#_TryMergeDrawCmdsObject



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

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

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



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

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



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

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



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

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

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



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

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



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

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

#AddConvexPolyFilled(points, num_points, col) ⇒ Object



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

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

#AddDrawCmdObject



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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

#ChannelsMergeObject



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

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

#ChannelsSetCurrent(n) ⇒ Object



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

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

#ChannelsSplit(count) ⇒ Object



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

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

#CloneOutputObject



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

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

#destroyObject



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

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

#GetClipRectMaxObject



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

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

#GetClipRectMinObject



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

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

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



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

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



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

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



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

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



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

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

#PathClearObject



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

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

#PathFillConvex(col) ⇒ Object



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

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

#PathLineTo(pos) ⇒ Object



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

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

#PathLineToMergeDuplicate(pos) ⇒ Object



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

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

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



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

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



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

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

#PopClipRectObject



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

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

#PopTextureIDObject



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

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

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



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

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



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

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

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



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

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



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

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

#PrimUnreserve(idx_count, vtx_count) ⇒ Object



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

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

#PrimVtx(pos, uv, col) ⇒ Object



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

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

#PrimWriteIdx(idx) ⇒ Object



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

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

#PrimWriteVtx(pos, uv, col) ⇒ Object



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

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



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

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



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

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

#PushTextureID(texture_id) ⇒ Object



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

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