11 #if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H) 19 #define IMGUI_VERSION "1.50 WIP" 29 #define IM_ASSERT(_EXPR) assert(_EXPR) 33 #if defined(__clang__) || defined(__GNUC__) 34 #define IM_PRINTFARGS(FMT) __attribute__((format(printf, FMT, (FMT+1)))) 36 #define IM_PRINTFARGS(FMT) 39 #if defined(__clang__) 40 #pragma clang diagnostic push 41 #pragma clang diagnostic ignored "-Wold-style-cast" 66 typedef unsigned int ImU32;
67 typedef unsigned short ImWchar;
68 typedef void* ImTextureID;
69 typedef ImU32 ImGuiID;
71 typedef int ImGuiStyleVar;
73 typedef int ImGuiAlign;
74 typedef int ImGuiColorEditMode;
75 typedef int ImGuiMouseCursor;
76 typedef int ImGuiWindowFlags;
77 typedef int ImGuiSetCond;
78 typedef int ImGuiInputTextFlags;
79 typedef int ImGuiSelectableFlags;
80 typedef int ImGuiTreeNodeFlags;
92 ImVec2(
float _x,
float _y) { x = _x; y = _y; }
93 #ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2. 101 ImVec4() { x = y = z = w = 0.0f; }
102 ImVec4(
float _x,
float _y,
float _z,
float _w) { x = _x; y = _y; z = _z; w = _w; }
103 #ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec4. 116 IMGUI_API
void NewFrame();
117 IMGUI_API
void Render();
118 IMGUI_API
void Shutdown();
119 IMGUI_API
void ShowUserGuide();
120 IMGUI_API
void ShowStyleEditor(
ImGuiStyle* ref = NULL);
121 IMGUI_API
void ShowTestWindow(
bool* p_open = NULL);
122 IMGUI_API
void ShowMetricsWindow(
bool* p_open = NULL);
125 IMGUI_API
bool Begin(
const char* name,
bool* p_open = NULL, ImGuiWindowFlags flags = 0);
126 IMGUI_API
bool Begin(
const char* name,
bool* p_open,
const ImVec2& size_on_first_use,
float bg_alpha = -1.0f, ImGuiWindowFlags flags = 0);
127 IMGUI_API
void End();
128 IMGUI_API
bool BeginChild(
const char* str_id,
const ImVec2& size =
ImVec2(0,0),
bool border =
false, ImGuiWindowFlags extra_flags = 0);
129 IMGUI_API
bool BeginChild(ImGuiID
id,
const ImVec2& size =
ImVec2(0,0),
bool border =
false, ImGuiWindowFlags extra_flags = 0);
130 IMGUI_API
void EndChild();
131 IMGUI_API
ImVec2 GetContentRegionMax();
132 IMGUI_API
ImVec2 GetContentRegionAvail();
133 IMGUI_API
float GetContentRegionAvailWidth();
134 IMGUI_API
ImVec2 GetWindowContentRegionMin();
135 IMGUI_API
ImVec2 GetWindowContentRegionMax();
136 IMGUI_API
float GetWindowContentRegionWidth();
138 IMGUI_API
ImVec2 GetWindowPos();
139 IMGUI_API
ImVec2 GetWindowSize();
140 IMGUI_API
float GetWindowWidth();
141 IMGUI_API
float GetWindowHeight();
142 IMGUI_API
bool IsWindowCollapsed();
143 IMGUI_API
void SetWindowFontScale(
float scale);
145 IMGUI_API
void SetNextWindowPos(
const ImVec2& pos, ImGuiSetCond cond = 0);
146 IMGUI_API
void SetNextWindowPosCenter(ImGuiSetCond cond = 0);
147 IMGUI_API
void SetNextWindowSize(
const ImVec2& size, ImGuiSetCond cond = 0);
148 IMGUI_API
void SetNextWindowSizeConstraints(
const ImVec2& size_min,
const ImVec2& size_max, ImGuiSizeConstraintCallback custom_callback = NULL,
void* custom_callback_data = NULL);
149 IMGUI_API
void SetNextWindowContentSize(
const ImVec2& size);
150 IMGUI_API
void SetNextWindowContentWidth(
float width);
151 IMGUI_API
void SetNextWindowCollapsed(
bool collapsed, ImGuiSetCond cond = 0);
152 IMGUI_API
void SetNextWindowFocus();
153 IMGUI_API
void SetWindowPos(
const ImVec2& pos, ImGuiSetCond cond = 0);
154 IMGUI_API
void SetWindowSize(
const ImVec2& size, ImGuiSetCond cond = 0);
155 IMGUI_API
void SetWindowCollapsed(
bool collapsed, ImGuiSetCond cond = 0);
156 IMGUI_API
void SetWindowFocus();
157 IMGUI_API
void SetWindowPos(
const char* name,
const ImVec2& pos, ImGuiSetCond cond = 0);
158 IMGUI_API
void SetWindowSize(
const char* name,
const ImVec2& size, ImGuiSetCond cond = 0);
159 IMGUI_API
void SetWindowCollapsed(
const char* name,
bool collapsed, ImGuiSetCond cond = 0);
160 IMGUI_API
void SetWindowFocus(
const char* name);
162 IMGUI_API
float GetScrollX();
163 IMGUI_API
float GetScrollY();
164 IMGUI_API
float GetScrollMaxX();
165 IMGUI_API
float GetScrollMaxY();
166 IMGUI_API
void SetScrollX(
float scroll_x);
167 IMGUI_API
void SetScrollY(
float scroll_y);
168 IMGUI_API
void SetScrollHere(
float center_y_ratio = 0.5f);
169 IMGUI_API
void SetScrollFromPosY(
float pos_y,
float center_y_ratio = 0.5f);
170 IMGUI_API
void SetKeyboardFocusHere(
int offset = 0);
175 IMGUI_API
void PushFont(
ImFont* font);
176 IMGUI_API
void PopFont();
177 IMGUI_API
void PushStyleColor(ImGuiCol idx,
const ImVec4& col);
178 IMGUI_API
void PopStyleColor(
int count = 1);
179 IMGUI_API
void PushStyleVar(ImGuiStyleVar idx,
float val);
180 IMGUI_API
void PushStyleVar(ImGuiStyleVar idx,
const ImVec2& val);
181 IMGUI_API
void PopStyleVar(
int count = 1);
182 IMGUI_API
ImFont* GetFont();
183 IMGUI_API
float GetFontSize();
184 IMGUI_API
ImVec2 GetFontTexUvWhitePixel();
185 IMGUI_API ImU32 GetColorU32(ImGuiCol idx,
float alpha_mul = 1.0f);
186 IMGUI_API ImU32 GetColorU32(
const ImVec4& col);
189 IMGUI_API
void PushItemWidth(
float item_width);
190 IMGUI_API
void PopItemWidth();
191 IMGUI_API
float CalcItemWidth();
192 IMGUI_API
void PushTextWrapPos(
float wrap_pos_x = 0.0f);
193 IMGUI_API
void PopTextWrapPos();
194 IMGUI_API
void PushAllowKeyboardFocus(
bool v);
195 IMGUI_API
void PopAllowKeyboardFocus();
196 IMGUI_API
void PushButtonRepeat(
bool repeat);
197 IMGUI_API
void PopButtonRepeat();
200 IMGUI_API
void Separator();
201 IMGUI_API
void SameLine(
float pos_x = 0.0f,
float spacing_w = -1.0f);
202 IMGUI_API
void NewLine();
203 IMGUI_API
void Spacing();
204 IMGUI_API
void Dummy(
const ImVec2& size);
205 IMGUI_API
void Indent(
float indent_w = 0.0f);
206 IMGUI_API
void Unindent(
float indent_w = 0.0f);
207 IMGUI_API
void BeginGroup();
208 IMGUI_API
void EndGroup();
209 IMGUI_API
ImVec2 GetCursorPos();
210 IMGUI_API
float GetCursorPosX();
211 IMGUI_API
float GetCursorPosY();
212 IMGUI_API
void SetCursorPos(
const ImVec2& local_pos);
213 IMGUI_API
void SetCursorPosX(
float x);
214 IMGUI_API
void SetCursorPosY(
float y);
215 IMGUI_API
ImVec2 GetCursorStartPos();
216 IMGUI_API
ImVec2 GetCursorScreenPos();
217 IMGUI_API
void SetCursorScreenPos(
const ImVec2& pos);
218 IMGUI_API
void AlignFirstTextHeightToWidgets();
219 IMGUI_API
float GetTextLineHeight();
220 IMGUI_API
float GetTextLineHeightWithSpacing();
221 IMGUI_API
float GetItemsLineHeightWithSpacing();
225 IMGUI_API
void Columns(
int count = 1,
const char*
id = NULL,
bool border =
true);
226 IMGUI_API
void NextColumn();
227 IMGUI_API
int GetColumnIndex();
228 IMGUI_API
float GetColumnOffset(
int column_index = -1);
229 IMGUI_API
void SetColumnOffset(
int column_index,
float offset_x);
230 IMGUI_API
float GetColumnWidth(
int column_index = -1);
231 IMGUI_API
int GetColumnsCount();
236 IMGUI_API
void PushID(
const char* str_id);
237 IMGUI_API
void PushID(
const char* str_id_begin,
const char* str_id_end);
238 IMGUI_API
void PushID(
const void* ptr_id);
239 IMGUI_API
void PushID(
int int_id);
240 IMGUI_API
void PopID();
241 IMGUI_API ImGuiID GetID(
const char* str_id);
242 IMGUI_API ImGuiID GetID(
const char* str_id_begin,
const char* str_id_end);
243 IMGUI_API ImGuiID GetID(
const void* ptr_id);
246 IMGUI_API
void Text(
const char* fmt, ...) IM_PRINTFARGS(1);
247 IMGUI_API
void TextV(
const char* fmt, va_list args);
248 IMGUI_API
void TextColored(
const ImVec4& col,
const char* fmt, ...) IM_PRINTFARGS(2);
249 IMGUI_API
void TextColoredV(
const ImVec4& col,
const char* fmt, va_list args);
250 IMGUI_API
void TextDisabled(
const char* fmt, ...) IM_PRINTFARGS(1);
251 IMGUI_API
void TextDisabledV(
const char* fmt, va_list args);
252 IMGUI_API
void TextWrapped(
const char* fmt, ...) IM_PRINTFARGS(1);
253 IMGUI_API
void TextWrappedV(
const char* fmt, va_list args);
254 IMGUI_API
void TextUnformatted(
const char* text,
const char* text_end = NULL);
255 IMGUI_API
void LabelText(
const char* label,
const char* fmt, ...) IM_PRINTFARGS(2);
256 IMGUI_API
void LabelTextV(
const char* label,
const char* fmt, va_list args);
257 IMGUI_API
void Bullet();
258 IMGUI_API
void BulletText(
const char* fmt, ...) IM_PRINTFARGS(1);
259 IMGUI_API
void BulletTextV(
const char* fmt, va_list args);
260 IMGUI_API
bool Button(
const char* label,
const ImVec2& size =
ImVec2(0,0));
261 IMGUI_API
bool SmallButton(
const char* label);
262 IMGUI_API
bool InvisibleButton(
const char* str_id,
const ImVec2& size);
263 IMGUI_API
void Image(ImTextureID user_texture_id,
const ImVec2& size,
const ImVec2& uv0 =
ImVec2(0,0),
const ImVec2& uv1 =
ImVec2(1,1),
const ImVec4& tint_col =
ImVec4(1,1,1,1),
const ImVec4& border_col =
ImVec4(0,0,0,0));
264 IMGUI_API
bool ImageButton(ImTextureID user_texture_id,
const ImVec2& size,
const ImVec2& uv0 =
ImVec2(0,0),
const ImVec2& uv1 =
ImVec2(1,1),
int frame_padding = -1,
const ImVec4& bg_col =
ImVec4(0,0,0,0),
const ImVec4& tint_col =
ImVec4(1,1,1,1));
265 IMGUI_API
bool Checkbox(
const char* label,
bool* v);
266 IMGUI_API
bool CheckboxFlags(
const char* label,
unsigned int* flags,
unsigned int flags_value);
267 IMGUI_API
bool RadioButton(
const char* label,
bool active);
268 IMGUI_API
bool RadioButton(
const char* label,
int* v,
int v_button);
269 IMGUI_API
bool Combo(
const char* label,
int* current_item,
const char** items,
int items_count,
int height_in_items = -1);
270 IMGUI_API
bool Combo(
const char* label,
int* current_item,
const char* items_separated_by_zeros,
int height_in_items = -1);
271 IMGUI_API
bool Combo(
const char* label,
int* current_item,
bool (*items_getter)(
void* data,
int idx,
const char** out_text),
void* data,
int items_count,
int height_in_items = -1);
272 IMGUI_API
bool ColorButton(
const ImVec4& col,
bool small_height =
false,
bool outline_border =
true);
273 IMGUI_API
bool ColorEdit3(
const char* label,
float col[3]);
274 IMGUI_API
bool ColorEdit4(
const char* label,
float col[4],
bool show_alpha =
true);
275 IMGUI_API
void ColorEditMode(ImGuiColorEditMode mode);
276 IMGUI_API
void PlotLines(
const char* label,
const float* values,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0),
int stride =
sizeof(
float));
277 IMGUI_API
void PlotLines(
const char* label,
float (*values_getter)(
void* data,
int idx),
void* data,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0));
278 IMGUI_API
void PlotHistogram(
const char* label,
const float* values,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0),
int stride =
sizeof(
float));
279 IMGUI_API
void PlotHistogram(
const char* label,
float (*values_getter)(
void* data,
int idx),
void* data,
int values_count,
int values_offset = 0,
const char* overlay_text = NULL,
float scale_min = FLT_MAX,
float scale_max = FLT_MAX,
ImVec2 graph_size =
ImVec2(0,0));
280 IMGUI_API
void ProgressBar(
float fraction,
const ImVec2& size_arg =
ImVec2(-1,0),
const char* overlay = NULL);
284 IMGUI_API
bool DragFloat(
const char* label,
float* v,
float v_speed = 1.0f,
float v_min = 0.0f,
float v_max = 0.0f,
const char* display_format =
"%.3f",
float power = 1.0f);
285 IMGUI_API
bool DragFloat2(
const char* label,
float v[2],
float v_speed = 1.0f,
float v_min = 0.0f,
float v_max = 0.0f,
const char* display_format =
"%.3f",
float power = 1.0f);
286 IMGUI_API
bool DragFloat3(
const char* label,
float v[3],
float v_speed = 1.0f,
float v_min = 0.0f,
float v_max = 0.0f,
const char* display_format =
"%.3f",
float power = 1.0f);
287 IMGUI_API
bool DragFloat4(
const char* label,
float v[4],
float v_speed = 1.0f,
float v_min = 0.0f,
float v_max = 0.0f,
const char* display_format =
"%.3f",
float power = 1.0f);
288 IMGUI_API
bool DragFloatRange2(
const char* label,
float* v_current_min,
float* v_current_max,
float v_speed = 1.0f,
float v_min = 0.0f,
float v_max = 0.0f,
const char* display_format =
"%.3f",
const char* display_format_max = NULL,
float power = 1.0f);
289 IMGUI_API
bool DragInt(
const char* label,
int* v,
float v_speed = 1.0f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
290 IMGUI_API
bool DragInt2(
const char* label,
int v[2],
float v_speed = 1.0f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
291 IMGUI_API
bool DragInt3(
const char* label,
int v[3],
float v_speed = 1.0f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
292 IMGUI_API
bool DragInt4(
const char* label,
int v[4],
float v_speed = 1.0f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f");
293 IMGUI_API
bool DragIntRange2(
const char* label,
int* v_current_min,
int* v_current_max,
float v_speed = 1.0f,
int v_min = 0,
int v_max = 0,
const char* display_format =
"%.0f",
const char* display_format_max = NULL);
296 IMGUI_API
bool InputText(
const char* label,
char* buf,
size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL,
void* user_data = NULL);
297 IMGUI_API
bool InputTextMultiline(
const char* label,
char* buf,
size_t buf_size,
const ImVec2& size =
ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL,
void* user_data = NULL);
298 IMGUI_API
bool InputFloat(
const char* label,
float* v,
float step = 0.0f,
float step_fast = 0.0f,
int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
299 IMGUI_API
bool InputFloat2(
const char* label,
float v[2],
int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
300 IMGUI_API
bool InputFloat3(
const char* label,
float v[3],
int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
301 IMGUI_API
bool InputFloat4(
const char* label,
float v[4],
int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
302 IMGUI_API
bool InputInt(
const char* label,
int* v,
int step = 1,
int step_fast = 100, ImGuiInputTextFlags extra_flags = 0);
303 IMGUI_API
bool InputInt2(
const char* label,
int v[2], ImGuiInputTextFlags extra_flags = 0);
304 IMGUI_API
bool InputInt3(
const char* label,
int v[3], ImGuiInputTextFlags extra_flags = 0);
305 IMGUI_API
bool InputInt4(
const char* label,
int v[4], ImGuiInputTextFlags extra_flags = 0);
308 IMGUI_API
bool SliderFloat(
const char* label,
float* v,
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0f);
309 IMGUI_API
bool SliderFloat2(
const char* label,
float v[2],
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0f);
310 IMGUI_API
bool SliderFloat3(
const char* label,
float v[3],
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0f);
311 IMGUI_API
bool SliderFloat4(
const char* label,
float v[4],
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0f);
312 IMGUI_API
bool SliderAngle(
const char* label,
float* v_rad,
float v_degrees_min = -360.0f,
float v_degrees_max = +360.0f);
313 IMGUI_API
bool SliderInt(
const char* label,
int* v,
int v_min,
int v_max,
const char* display_format =
"%.0f");
314 IMGUI_API
bool SliderInt2(
const char* label,
int v[2],
int v_min,
int v_max,
const char* display_format =
"%.0f");
315 IMGUI_API
bool SliderInt3(
const char* label,
int v[3],
int v_min,
int v_max,
const char* display_format =
"%.0f");
316 IMGUI_API
bool SliderInt4(
const char* label,
int v[4],
int v_min,
int v_max,
const char* display_format =
"%.0f");
317 IMGUI_API
bool VSliderFloat(
const char* label,
const ImVec2& size,
float* v,
float v_min,
float v_max,
const char* display_format =
"%.3f",
float power = 1.0f);
318 IMGUI_API
bool VSliderInt(
const char* label,
const ImVec2& size,
int* v,
int v_min,
int v_max,
const char* display_format =
"%.0f");
321 IMGUI_API
bool TreeNode(
const char* label);
322 IMGUI_API
bool TreeNode(
const char* str_id,
const char* fmt, ...) IM_PRINTFARGS(2);
323 IMGUI_API
bool TreeNode(
const void* ptr_id,
const char* fmt, ...) IM_PRINTFARGS(2);
324 IMGUI_API
bool TreeNodeV(
const char* str_id,
const char* fmt, va_list args);
325 IMGUI_API
bool TreeNodeV(
const void* ptr_id,
const char* fmt, va_list args);
326 IMGUI_API
bool TreeNodeEx(
const char* label, ImGuiTreeNodeFlags flags = 0);
327 IMGUI_API
bool TreeNodeEx(
const char* str_id, ImGuiTreeNodeFlags flags,
const char* fmt, ...) IM_PRINTFARGS(3);
328 IMGUI_API
bool TreeNodeEx(
const void* ptr_id, ImGuiTreeNodeFlags flags,
const char* fmt, ...) IM_PRINTFARGS(3);
329 IMGUI_API
bool TreeNodeExV(
const char* str_id, ImGuiTreeNodeFlags flags,
const char* fmt, va_list args);
330 IMGUI_API
bool TreeNodeExV(
const void* ptr_id, ImGuiTreeNodeFlags flags,
const char* fmt, va_list args);
331 IMGUI_API
void TreePush(
const char* str_id = NULL);
332 IMGUI_API
void TreePush(
const void* ptr_id = NULL);
333 IMGUI_API
void TreePop();
334 IMGUI_API
void TreeAdvanceToLabelPos();
335 IMGUI_API
float GetTreeNodeToLabelSpacing();
336 IMGUI_API
void SetNextTreeNodeOpen(
bool is_open, ImGuiSetCond cond = 0);
337 IMGUI_API
bool CollapsingHeader(
const char* label, ImGuiTreeNodeFlags flags = 0);
338 IMGUI_API
bool CollapsingHeader(
const char* label,
bool* p_open, ImGuiTreeNodeFlags flags = 0);
341 IMGUI_API
bool Selectable(
const char* label,
bool selected =
false, ImGuiSelectableFlags flags = 0,
const ImVec2& size =
ImVec2(0,0));
342 IMGUI_API
bool Selectable(
const char* label,
bool* p_selected, ImGuiSelectableFlags flags = 0,
const ImVec2& size =
ImVec2(0,0));
343 IMGUI_API
bool ListBox(
const char* label,
int* current_item,
const char** items,
int items_count,
int height_in_items = -1);
344 IMGUI_API
bool ListBox(
const char* label,
int* current_item,
bool (*items_getter)(
void* data,
int idx,
const char** out_text),
void* data,
int items_count,
int height_in_items = -1);
345 IMGUI_API
bool ListBoxHeader(
const char* label,
const ImVec2& size =
ImVec2(0,0));
346 IMGUI_API
bool ListBoxHeader(
const char* label,
int items_count,
int height_in_items = -1);
347 IMGUI_API
void ListBoxFooter();
350 IMGUI_API
void Value(
const char* prefix,
bool b);
351 IMGUI_API
void Value(
const char* prefix,
int v);
352 IMGUI_API
void Value(
const char* prefix,
unsigned int v);
353 IMGUI_API
void Value(
const char* prefix,
float v,
const char* float_format = NULL);
354 IMGUI_API
void ValueColor(
const char* prefix,
const ImVec4& v);
355 IMGUI_API
void ValueColor(
const char* prefix,
unsigned int v);
358 IMGUI_API
void SetTooltip(
const char* fmt, ...) IM_PRINTFARGS(1);
359 IMGUI_API
void SetTooltipV(
const char* fmt, va_list args);
360 IMGUI_API
void BeginTooltip();
361 IMGUI_API
void EndTooltip();
364 IMGUI_API
bool BeginMainMenuBar();
365 IMGUI_API
void EndMainMenuBar();
366 IMGUI_API
bool BeginMenuBar();
367 IMGUI_API
void EndMenuBar();
368 IMGUI_API
bool BeginMenu(
const char* label,
bool enabled =
true);
369 IMGUI_API
void EndMenu();
370 IMGUI_API
bool MenuItem(
const char* label,
const char* shortcut = NULL,
bool selected =
false,
bool enabled =
true);
371 IMGUI_API
bool MenuItem(
const char* label,
const char* shortcut,
bool* p_selected,
bool enabled =
true);
374 IMGUI_API
void OpenPopup(
const char* str_id);
375 IMGUI_API
bool BeginPopup(
const char* str_id);
376 IMGUI_API
bool BeginPopupModal(
const char* name,
bool* p_open = NULL, ImGuiWindowFlags extra_flags = 0);
377 IMGUI_API
bool BeginPopupContextItem(
const char* str_id,
int mouse_button = 1);
378 IMGUI_API
bool BeginPopupContextWindow(
bool also_over_items =
true,
const char* str_id = NULL,
int mouse_button = 1);
379 IMGUI_API
bool BeginPopupContextVoid(
const char* str_id = NULL,
int mouse_button = 1);
380 IMGUI_API
void EndPopup();
381 IMGUI_API
void CloseCurrentPopup();
384 IMGUI_API
void LogToTTY(
int max_depth = -1);
385 IMGUI_API
void LogToFile(
int max_depth = -1,
const char* filename = NULL);
386 IMGUI_API
void LogToClipboard(
int max_depth = -1);
387 IMGUI_API
void LogFinish();
388 IMGUI_API
void LogButtons();
389 IMGUI_API
void LogText(
const char* fmt, ...) IM_PRINTFARGS(1);
392 IMGUI_API
void PushClipRect(
const ImVec2& clip_rect_min,
const ImVec2& clip_rect_max,
bool intersect_with_current_clip_rect);
393 IMGUI_API
void PopClipRect();
396 IMGUI_API
bool IsItemHovered();
397 IMGUI_API
bool IsItemHoveredRect();
398 IMGUI_API
bool IsItemActive();
399 IMGUI_API
bool IsItemClicked(
int mouse_button = 0);
400 IMGUI_API
bool IsItemVisible();
401 IMGUI_API
bool IsAnyItemHovered();
402 IMGUI_API
bool IsAnyItemActive();
403 IMGUI_API
ImVec2 GetItemRectMin();
404 IMGUI_API
ImVec2 GetItemRectMax();
405 IMGUI_API
ImVec2 GetItemRectSize();
406 IMGUI_API
void SetItemAllowOverlap();
407 IMGUI_API
bool IsWindowHovered();
408 IMGUI_API
bool IsWindowFocused();
409 IMGUI_API
bool IsRootWindowFocused();
410 IMGUI_API
bool IsRootWindowOrAnyChildFocused();
411 IMGUI_API
bool IsRootWindowOrAnyChildHovered();
412 IMGUI_API
bool IsRectVisible(
const ImVec2& size);
413 IMGUI_API
bool IsPosHoveringAnyWindow(
const ImVec2& pos);
414 IMGUI_API
float GetTime();
415 IMGUI_API
int GetFrameCount();
416 IMGUI_API
const char* GetStyleColName(ImGuiCol idx);
417 IMGUI_API
ImVec2 CalcItemRectClosestPoint(
const ImVec2& pos,
bool on_edge =
false,
float outward = +0.0f);
418 IMGUI_API
ImVec2 CalcTextSize(
const char* text,
const char* text_end = NULL,
bool hide_text_after_double_hash =
false,
float wrap_width = -1.0f);
419 IMGUI_API
void CalcListClipping(
int items_count,
float items_height,
int* out_items_display_start,
int* out_items_display_end);
421 IMGUI_API
bool BeginChildFrame(ImGuiID
id,
const ImVec2& size, ImGuiWindowFlags extra_flags = 0);
422 IMGUI_API
void EndChildFrame();
424 IMGUI_API
ImVec4 ColorConvertU32ToFloat4(ImU32 in);
425 IMGUI_API ImU32 ColorConvertFloat4ToU32(
const ImVec4& in);
426 IMGUI_API
void ColorConvertRGBtoHSV(
float r,
float g,
float b,
float& out_h,
float& out_s,
float& out_v);
427 IMGUI_API
void ColorConvertHSVtoRGB(
float h,
float s,
float v,
float& out_r,
float& out_g,
float& out_b);
430 IMGUI_API
int GetKeyIndex(ImGuiKey key);
431 IMGUI_API
bool IsKeyDown(
int key_index);
432 IMGUI_API
bool IsKeyPressed(
int key_index,
bool repeat =
true);
433 IMGUI_API
bool IsKeyReleased(
int key_index);
434 IMGUI_API
bool IsMouseDown(
int button);
435 IMGUI_API
bool IsMouseClicked(
int button,
bool repeat =
false);
436 IMGUI_API
bool IsMouseDoubleClicked(
int button);
437 IMGUI_API
bool IsMouseReleased(
int button);
438 IMGUI_API
bool IsMouseHoveringWindow();
439 IMGUI_API
bool IsMouseHoveringAnyWindow();
440 IMGUI_API
bool IsMouseHoveringRect(
const ImVec2& r_min,
const ImVec2& r_max,
bool clip =
true);
441 IMGUI_API
bool IsMouseDragging(
int button = 0,
float lock_threshold = -1.0f);
442 IMGUI_API
ImVec2 GetMousePos();
443 IMGUI_API
ImVec2 GetMousePosOnOpeningCurrentPopup();
444 IMGUI_API
ImVec2 GetMouseDragDelta(
int button = 0,
float lock_threshold = -1.0f);
445 IMGUI_API
void ResetMouseDragDelta(
int button = 0);
446 IMGUI_API ImGuiMouseCursor GetMouseCursor();
447 IMGUI_API
void SetMouseCursor(ImGuiMouseCursor type);
448 IMGUI_API
void CaptureKeyboardFromApp(
bool capture =
true);
449 IMGUI_API
void CaptureMouseFromApp(
bool capture =
true);
452 IMGUI_API
void* MemAlloc(
size_t sz);
453 IMGUI_API
void MemFree(
void* ptr);
454 IMGUI_API
const char* GetClipboardText();
455 IMGUI_API
void SetClipboardText(
const char* text);
459 IMGUI_API
const char* GetVersion();
460 IMGUI_API
ImGuiContext* CreateContext(
void* (*malloc_fn)(
size_t) = NULL,
void (*free_fn)(
void*) = NULL);
466 #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 467 static inline bool CollapsingHeader(
const char* label,
const char* str_id,
bool framed =
true,
bool default_open =
false) { (void)str_id; (void)framed; ImGuiTreeNodeFlags default_open_flags = 1<<5;
return CollapsingHeader(label, (default_open ? default_open_flags : 0)); }
468 static inline ImFont* GetWindowFont() {
return GetFont(); }
469 static inline float GetWindowFontSize() {
return GetFontSize(); }
470 static inline void OpenNextNode(
bool open) { ImGui::SetNextTreeNodeOpen(open, 0); }
471 static inline bool GetWindowIsFocused() {
return ImGui::IsWindowFocused(); }
472 static inline bool GetWindowCollapsed() {
return ImGui::IsWindowCollapsed(); }
473 static inline ImVec2 GetItemBoxMin() {
return GetItemRectMin(); }
474 static inline ImVec2 GetItemBoxMax() {
return GetItemRectMax(); }
475 static inline bool IsClipped(
const ImVec2& size) {
return !IsRectVisible(size); }
476 static inline bool IsRectClipped(
const ImVec2& size) {
return !IsRectVisible(size); }
477 static inline bool IsMouseHoveringBox(
const ImVec2& rect_min,
const ImVec2& rect_max) {
return IsMouseHoveringRect(rect_min, rect_max); }
478 static inline void SetScrollPosHere() { SetScrollHere(); }
484 enum ImGuiWindowFlags_
487 ImGuiWindowFlags_NoTitleBar = 1 << 0,
488 ImGuiWindowFlags_NoResize = 1 << 1,
489 ImGuiWindowFlags_NoMove = 1 << 2,
490 ImGuiWindowFlags_NoScrollbar = 1 << 3,
491 ImGuiWindowFlags_NoScrollWithMouse = 1 << 4,
492 ImGuiWindowFlags_NoCollapse = 1 << 5,
493 ImGuiWindowFlags_AlwaysAutoResize = 1 << 6,
494 ImGuiWindowFlags_ShowBorders = 1 << 7,
495 ImGuiWindowFlags_NoSavedSettings = 1 << 8,
496 ImGuiWindowFlags_NoInputs = 1 << 9,
497 ImGuiWindowFlags_MenuBar = 1 << 10,
498 ImGuiWindowFlags_HorizontalScrollbar = 1 << 11,
499 ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12,
500 ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13,
501 ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14,
502 ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15,
503 ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16,
505 ImGuiWindowFlags_ChildWindow = 1 << 20,
506 ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 21,
507 ImGuiWindowFlags_ChildWindowAutoFitY = 1 << 22,
508 ImGuiWindowFlags_ComboBox = 1 << 23,
509 ImGuiWindowFlags_Tooltip = 1 << 24,
510 ImGuiWindowFlags_Popup = 1 << 25,
511 ImGuiWindowFlags_Modal = 1 << 26,
512 ImGuiWindowFlags_ChildMenu = 1 << 27
516 enum ImGuiInputTextFlags_
519 ImGuiInputTextFlags_CharsDecimal = 1 << 0,
520 ImGuiInputTextFlags_CharsHexadecimal = 1 << 1,
521 ImGuiInputTextFlags_CharsUppercase = 1 << 2,
522 ImGuiInputTextFlags_CharsNoBlank = 1 << 3,
523 ImGuiInputTextFlags_AutoSelectAll = 1 << 4,
524 ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5,
525 ImGuiInputTextFlags_CallbackCompletion = 1 << 6,
526 ImGuiInputTextFlags_CallbackHistory = 1 << 7,
527 ImGuiInputTextFlags_CallbackAlways = 1 << 8,
528 ImGuiInputTextFlags_CallbackCharFilter = 1 << 9,
529 ImGuiInputTextFlags_AllowTabInput = 1 << 10,
530 ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11,
531 ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12,
532 ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13,
533 ImGuiInputTextFlags_ReadOnly = 1 << 14,
534 ImGuiInputTextFlags_Password = 1 << 15,
536 ImGuiInputTextFlags_Multiline = 1 << 20
540 enum ImGuiTreeNodeFlags_
542 ImGuiTreeNodeFlags_Selected = 1 << 0,
543 ImGuiTreeNodeFlags_Framed = 1 << 1,
544 ImGuiTreeNodeFlags_AllowOverlapMode = 1 << 2,
545 ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3,
546 ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4,
547 ImGuiTreeNodeFlags_DefaultOpen = 1 << 5,
548 ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6,
549 ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7,
550 ImGuiTreeNodeFlags_Leaf = 1 << 8,
551 ImGuiTreeNodeFlags_Bullet = 1 << 9,
554 ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoAutoOpenOnLog
558 enum ImGuiSelectableFlags_
561 ImGuiSelectableFlags_DontClosePopups = 1 << 0,
562 ImGuiSelectableFlags_SpanAllColumns = 1 << 1,
563 ImGuiSelectableFlags_AllowDoubleClick = 1 << 2
595 ImGuiCol_TextDisabled,
597 ImGuiCol_ChildWindowBg,
600 ImGuiCol_BorderShadow,
602 ImGuiCol_FrameBgHovered,
603 ImGuiCol_FrameBgActive,
605 ImGuiCol_TitleBgCollapsed,
606 ImGuiCol_TitleBgActive,
608 ImGuiCol_ScrollbarBg,
609 ImGuiCol_ScrollbarGrab,
610 ImGuiCol_ScrollbarGrabHovered,
611 ImGuiCol_ScrollbarGrabActive,
615 ImGuiCol_SliderGrabActive,
617 ImGuiCol_ButtonHovered,
618 ImGuiCol_ButtonActive,
620 ImGuiCol_HeaderHovered,
621 ImGuiCol_HeaderActive,
623 ImGuiCol_ColumnHovered,
624 ImGuiCol_ColumnActive,
626 ImGuiCol_ResizeGripHovered,
627 ImGuiCol_ResizeGripActive,
628 ImGuiCol_CloseButton,
629 ImGuiCol_CloseButtonHovered,
630 ImGuiCol_CloseButtonActive,
632 ImGuiCol_PlotLinesHovered,
633 ImGuiCol_PlotHistogram,
634 ImGuiCol_PlotHistogramHovered,
635 ImGuiCol_TextSelectedBg,
636 ImGuiCol_ModalWindowDarkening,
645 ImGuiStyleVar_WindowPadding,
646 ImGuiStyleVar_WindowRounding,
647 ImGuiStyleVar_WindowMinSize,
648 ImGuiStyleVar_ChildWindowRounding,
649 ImGuiStyleVar_FramePadding,
650 ImGuiStyleVar_FrameRounding,
651 ImGuiStyleVar_ItemSpacing,
652 ImGuiStyleVar_ItemInnerSpacing,
653 ImGuiStyleVar_IndentSpacing,
654 ImGuiStyleVar_GrabMinSize
659 ImGuiAlign_Left = 1 << 0,
660 ImGuiAlign_Center = 1 << 1,
661 ImGuiAlign_Right = 1 << 2,
662 ImGuiAlign_Top = 1 << 3,
663 ImGuiAlign_VCenter = 1 << 4,
664 ImGuiAlign_Default = ImGuiAlign_Left | ImGuiAlign_Top
669 enum ImGuiColorEditMode_
671 ImGuiColorEditMode_UserSelect = -2,
672 ImGuiColorEditMode_UserSelectShowButton = -1,
673 ImGuiColorEditMode_RGB = 0,
674 ImGuiColorEditMode_HSV = 1,
675 ImGuiColorEditMode_HEX = 2
679 enum ImGuiMouseCursor_
681 ImGuiMouseCursor_Arrow = 0,
682 ImGuiMouseCursor_TextInput,
683 ImGuiMouseCursor_Move,
684 ImGuiMouseCursor_ResizeNS,
685 ImGuiMouseCursor_ResizeEW,
686 ImGuiMouseCursor_ResizeNESW,
687 ImGuiMouseCursor_ResizeNWSE,
688 ImGuiMouseCursor_Count_
695 ImGuiSetCond_Always = 1 << 0,
696 ImGuiSetCond_Once = 1 << 1,
697 ImGuiSetCond_FirstUseEver = 1 << 2,
698 ImGuiSetCond_Appearing = 1 << 3
706 float WindowRounding;
707 ImGuiAlign WindowTitleAlign;
708 float ChildWindowRounding;
715 float ColumnsMinSpacing;
717 float ScrollbarRounding;
720 ImVec2 DisplayWindowPadding;
721 ImVec2 DisplaySafeAreaPadding;
722 bool AntiAliasedLines;
723 bool AntiAliasedShapes;
724 float CurveTessellationTol;
725 ImVec4 Colors[ImGuiCol_COUNT];
741 const char* IniFilename;
742 const char* LogFilename;
743 float MouseDoubleClickTime;
744 float MouseDoubleClickMaxDist;
745 float MouseDragThreshold;
746 int KeyMap[ImGuiKey_COUNT];
747 float KeyRepeatDelay;
752 float FontGlobalScale;
753 bool FontAllowUserScaling;
754 ImVec2 DisplayFramebufferScale;
759 bool WordMovementUsesAltKey;
760 bool ShortcutsUseSuperKey;
761 bool DoubleClickSelectsWord;
762 bool MultiSelectUsesSuperKey;
775 const char* (*GetClipboardTextFn)();
776 void (*SetClipboardTextFn)(
const char* text);
780 void* (*MemAllocFn)(
size_t sz);
781 void (*MemFreeFn)(
void* ptr);
785 void (*ImeSetInputScreenPosFn)(
int x,
int y);
786 void* ImeWindowHandle;
795 bool MouseDrawCursor;
801 ImWchar InputCharacters[16+1];
804 IMGUI_API
void AddInputCharacter(ImWchar c);
805 IMGUI_API
void AddInputCharactersUTF8(
const char* utf8_chars);
806 inline void ClearInputCharacters() { InputCharacters[0] = 0; }
812 bool WantCaptureMouse;
813 bool WantCaptureKeyboard;
817 int MetricsRenderVertices;
818 int MetricsRenderIndices;
819 int MetricsActiveWindows;
827 bool MouseClicked[5];
828 ImVec2 MouseClickedPos[5];
829 float MouseClickedTime[5];
830 bool MouseDoubleClicked[5];
831 bool MouseReleased[5];
832 bool MouseDownOwned[5];
833 float MouseDownDuration[5];
834 float MouseDownDurationPrev[5];
835 float MouseDragMaxDistanceSqr[5];
836 float KeysDownDuration[512];
837 float KeysDownDurationPrev[512];
856 typedef T value_type;
857 typedef value_type* iterator;
858 typedef const value_type* const_iterator;
860 ImVector() { Size = Capacity = 0; Data = NULL; }
861 ~
ImVector() {
if (Data) ImGui::MemFree(Data); }
863 inline bool empty()
const {
return Size == 0; }
864 inline int size()
const {
return Size; }
865 inline int capacity()
const {
return Capacity; }
867 inline value_type& operator[](
int i) { IM_ASSERT(i < Size);
return Data[i]; }
868 inline const value_type& operator[](
int i)
const { IM_ASSERT(i < Size);
return Data[i]; }
870 inline void clear() {
if (Data) { Size = Capacity = 0; ImGui::MemFree(Data); Data = NULL; } }
871 inline iterator
begin() {
return Data; }
872 inline const_iterator
begin()
const {
return Data; }
873 inline iterator
end() {
return Data + Size; }
874 inline const_iterator
end()
const {
return Data + Size; }
875 inline value_type& front() { IM_ASSERT(Size > 0);
return Data[0]; }
876 inline const value_type& front()
const { IM_ASSERT(Size > 0);
return Data[0]; }
877 inline value_type& back() { IM_ASSERT(Size > 0);
return Data[Size-1]; }
878 inline const value_type& back()
const { IM_ASSERT(Size > 0);
return Data[Size-1]; }
879 inline void swap(
ImVector<T>& rhs) {
int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size;
int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
881 inline int _grow_capacity(
int new_size) {
int new_capacity = Capacity ? (Capacity + Capacity/2) : 8;
return new_capacity > new_size ? new_capacity : new_size; }
883 inline void resize(
int new_size) {
if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
884 inline void reserve(
int new_capacity)
886 if (new_capacity <= Capacity)
return;
887 T* new_data = (value_type*)ImGui::MemAlloc((
size_t)new_capacity *
sizeof(value_type));
888 memcpy(new_data, Data, (
size_t)Size *
sizeof(value_type));
889 ImGui::MemFree(Data);
891 Capacity = new_capacity;
894 inline void push_back(
const value_type& v) {
if (Size == Capacity) reserve(_grow_capacity(Size+1)); Data[Size++] = v; }
895 inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
897 inline iterator erase(const_iterator it) { IM_ASSERT(it >= Data && it < Data+Size);
const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((
size_t)Size - (
size_t)off - 1) *
sizeof(value_type)); Size--;
return Data + off; }
898 inline iterator insert(const_iterator it,
const value_type& v) { IM_ASSERT(it >= Data && it <= Data+Size);
const ptrdiff_t off = it - Data;
if (Size == Capacity) reserve(Capacity ? Capacity * 2 : 4);
if (off < (
int)Size) memmove(Data + off + 1, Data + off, ((
size_t)Size - (
size_t)off) *
sizeof(value_type)); Data[off] = v; Size++;
return Data + off; }
909 #define IMGUI_ONCE_UPON_A_FRAME static ImGuiOnceUponAFrame imgui_oaf##__LINE__; if (imgui_oaf##__LINE__) 913 mutable int RefFrame;
914 operator bool()
const {
int current_frame = ImGui::GetFrameCount();
if (RefFrame == current_frame)
return false; RefFrame = current_frame;
return true; }
926 TextRange(
const char* _b,
const char* _e) { b = _b; e = _e; }
927 const char*
begin()
const {
return b; }
928 const char*
end()
const {
return e; }
929 bool empty()
const {
return b == e; }
930 char front()
const {
return *b; }
931 static bool is_blank(
char c) {
return c ==
' ' || c ==
'\t'; }
932 void trim_blanks() {
while (b < e && is_blank(*b)) b++;
while (e > b && is_blank(*(e-1))) e--; }
942 void Clear() { InputBuf[0] = 0; Build(); }
943 bool Draw(
const char* label =
"Filter (inc,-exc)",
float width = 0.0f);
944 bool PassFilter(
const char* text,
const char* text_end = NULL)
const;
945 bool IsActive()
const {
return !Filters.empty(); }
946 IMGUI_API
void Build();
955 inline char operator[](
int i) {
return Buf.Data[i]; }
956 const char*
begin()
const {
return &Buf.front(); }
957 const char*
end()
const {
return &Buf.back(); }
958 int size()
const {
return Buf.Size - 1; }
959 bool empty() {
return Buf.Size <= 1; }
960 void clear() { Buf.clear(); Buf.push_back(0); }
961 const char* c_str()
const {
return Buf.Data; }
962 IMGUI_API
void append(
const char* fmt, ...) IM_PRINTFARGS(2);
963 IMGUI_API
void appendv(
const char* fmt, va_list args);
980 union {
int val_i;
float val_f;
void* val_p; };
981 Pair(ImGuiID _key,
int _val_i) { key = _key; val_i = _val_i; }
982 Pair(ImGuiID _key,
float _val_f) { key = _key; val_f = _val_f; }
983 Pair(ImGuiID _key,
void* _val_p) { key = _key; val_p = _val_p; }
990 IMGUI_API
void Clear();
991 IMGUI_API
int GetInt(ImGuiID key,
int default_val = 0)
const;
992 IMGUI_API
void SetInt(ImGuiID key,
int val);
993 IMGUI_API
bool GetBool(ImGuiID key,
bool default_val =
false)
const;
994 IMGUI_API
void SetBool(ImGuiID key,
bool val);
995 IMGUI_API
float GetFloat(ImGuiID key,
float default_val = 0.0f)
const;
996 IMGUI_API
void SetFloat(ImGuiID key,
float val);
997 IMGUI_API
void* GetVoidPtr(ImGuiID key)
const;
998 IMGUI_API
void SetVoidPtr(ImGuiID key,
void* val);
1005 IMGUI_API
int* GetIntRef(ImGuiID key,
int default_val = 0);
1006 IMGUI_API
bool* GetBoolRef(ImGuiID key,
bool default_val =
false);
1007 IMGUI_API
float* GetFloatRef(ImGuiID key,
float default_val = 0.0f);
1008 IMGUI_API
void** GetVoidPtrRef(ImGuiID key,
void* default_val = NULL);
1011 IMGUI_API
void SetAllInt(
int val);
1017 ImGuiInputTextFlags EventFlag;
1018 ImGuiInputTextFlags Flags;
1037 void DeleteChars(
int pos,
int bytes_count);
1038 void InsertChars(
int pos,
const char* text,
const char* text_end = NULL);
1039 bool HasSelection()
const {
return SelectionStart != SelectionEnd; }
1060 ImColor() { Value.x = Value.y = Value.z = Value.w = 0.0f; }
1061 ImColor(
int r,
int g,
int b,
int a = 255) {
float sc = 1.0f/255.0f; Value.x = (float)r * sc; Value.y = (float)g * sc; Value.z = (float)b * sc; Value.w = (float)a * sc; }
1062 ImColor(ImU32 rgba) {
float sc = 1.0f/255.0f; Value.x = (float)(rgba&0xFF) * sc; Value.y = (float)((rgba>>8)&0xFF) * sc; Value.z = (float)((rgba>>16)&0xFF) * sc; Value.w = (float)(rgba >> 24) * sc; }
1063 ImColor(
float r,
float g,
float b,
float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
1065 inline operator ImU32()
const {
return ImGui::ColorConvertFloat4ToU32(Value); }
1066 inline operator ImVec4()
const {
return Value; }
1068 inline void SetHSV(
float h,
float s,
float v,
float a = 1.0f){ ImGui::ColorConvertHSVtoRGB(h, s, v, Value.x, Value.y, Value.z); Value.w = a; }
1070 static ImColor HSV(
float h,
float s,
float v,
float a = 1.0f) {
float r,g,b; ImGui::ColorConvertHSVtoRGB(h, s, v, r, g, b);
return ImColor(r,g,b,a); }
1090 int ItemsCount, StepNo, DisplayStart, DisplayEnd;
1095 ImGuiListClipper(
int items_count = -1,
float items_height = -1.0f) { Begin(items_count, items_height); }
1098 IMGUI_API
bool Step();
1099 IMGUI_API
void Begin(
int items_count,
float items_height = -1.0f);
1100 IMGUI_API
void End();
1109 #define IM_COL32(R,G,B,A) (((ImU32)(A)<<24) | ((ImU32)(B)<<16) | ((ImU32)(G)<<8) | ((ImU32)(R))) 1110 #define IM_COL32_WHITE (0xFFFFFFFF) 1111 #define IM_COL32_BLACK (0xFF000000) 1112 #define IM_COL32_BLACK_TRANS (0x00000000) // Transparent black 1123 unsigned int ElemCount;
1125 ImTextureID TextureId;
1126 ImDrawCallback UserCallback;
1127 void* UserCallbackData;
1129 ImDrawCmd() { ElemCount = 0; ClipRect.x = ClipRect.y = -8192.0f; ClipRect.z = ClipRect.w = +8192.0f; TextureId = NULL; UserCallback = NULL; UserCallbackData = NULL; }
1134 typedef unsigned short ImDrawIdx;
1138 #ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT 1149 IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
1174 const char* _OwnerName;
1175 unsigned int _VtxCurrentIdx;
1177 ImDrawIdx* _IdxWritePtr;
1181 int _ChannelsCurrent;
1187 IMGUI_API
void PushClipRect(
ImVec2 clip_rect_min,
ImVec2 clip_rect_max,
bool intersect_with_current_clip_rect =
false);
1188 IMGUI_API
void PushClipRectFullScreen();
1189 IMGUI_API
void PopClipRect();
1190 IMGUI_API
void PushTextureID(
const ImTextureID& texture_id);
1191 IMGUI_API
void PopTextureID();
1194 IMGUI_API
void AddLine(
const ImVec2& a,
const ImVec2& b, ImU32 col,
float thickness = 1.0f);
1195 IMGUI_API
void AddRect(
const ImVec2& a,
const ImVec2& b, ImU32 col,
float rounding = 0.0f,
int rounding_corners = 0x0F,
float thickness = 1.0f);
1196 IMGUI_API
void AddRectFilled(
const ImVec2& a,
const ImVec2& b, ImU32 col,
float rounding = 0.0f,
int rounding_corners = 0x0F);
1197 IMGUI_API
void AddRectFilledMultiColor(
const ImVec2& a,
const ImVec2& b, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
1198 IMGUI_API
void AddQuad(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c,
const ImVec2& d, ImU32 col,
float thickness = 1.0f);
1200 IMGUI_API
void AddTriangle(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c, ImU32 col,
float thickness = 1.0f);
1201 IMGUI_API
void AddTriangleFilled(
const ImVec2& a,
const ImVec2& b,
const ImVec2& c, ImU32 col);
1202 IMGUI_API
void AddCircle(
const ImVec2& centre,
float radius, ImU32 col,
int num_segments = 12,
float thickness = 1.0f);
1203 IMGUI_API
void AddCircleFilled(
const ImVec2& centre,
float radius, ImU32 col,
int num_segments = 12);
1204 IMGUI_API
void AddText(
const ImVec2& pos, ImU32 col,
const char* text_begin,
const char* text_end = NULL);
1205 IMGUI_API
void AddText(
const ImFont* font,
float font_size,
const ImVec2& pos, ImU32 col,
const char* text_begin,
const char* text_end = NULL,
float wrap_width = 0.0f,
const ImVec4* cpu_fine_clip_rect = NULL);
1206 IMGUI_API
void AddImage(ImTextureID user_texture_id,
const ImVec2& a,
const ImVec2& b,
const ImVec2& uv0 =
ImVec2(0,0),
const ImVec2& uv1 =
ImVec2(1,1), ImU32 col = 0xFFFFFFFF);
1207 IMGUI_API
void AddPolyline(
const ImVec2* points,
const int num_points, ImU32 col,
bool closed,
float thickness,
bool anti_aliased);
1208 IMGUI_API
void AddConvexPolyFilled(
const ImVec2* points,
const int num_points, ImU32 col,
bool anti_aliased);
1209 IMGUI_API
void AddBezierCurve(
const ImVec2& pos0,
const ImVec2& cp0,
const ImVec2& cp1,
const ImVec2& pos1, ImU32 col,
float thickness,
int num_segments = 0);
1212 inline void PathClear() { _Path.resize(0); }
1213 inline void PathLineTo(
const ImVec2& pos) { _Path.push_back(pos); }
1214 inline void PathLineToMergeDuplicate(
const ImVec2& pos) {
if (_Path.Size == 0 || memcmp(&_Path[_Path.Size-1], &pos, 8) != 0) _Path.push_back(pos); }
1215 inline void PathFill(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col,
true); PathClear(); }
1216 inline void PathStroke(ImU32 col,
bool closed,
float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness,
true); PathClear(); }
1217 IMGUI_API
void PathArcTo(
const ImVec2& centre,
float radius,
float a_min,
float a_max,
int num_segments = 10);
1218 IMGUI_API
void PathArcToFast(
const ImVec2& centre,
float radius,
int a_min_of_12,
int a_max_of_12);
1219 IMGUI_API
void PathBezierCurveTo(
const ImVec2& p1,
const ImVec2& p2,
const ImVec2& p3,
int num_segments = 0);
1220 IMGUI_API
void PathRect(
const ImVec2& rect_min,
const ImVec2& rect_max,
float rounding = 0.0f,
int rounding_corners = 0x0F);
1225 IMGUI_API
void ChannelsSplit(
int channels_count);
1226 IMGUI_API
void ChannelsMerge();
1227 IMGUI_API
void ChannelsSetCurrent(
int channel_index);
1230 IMGUI_API
void AddCallback(ImDrawCallback callback,
void* callback_data);
1231 IMGUI_API
void AddDrawCmd();
1235 IMGUI_API
void Clear();
1236 IMGUI_API
void ClearFreeMemory();
1237 IMGUI_API
void PrimReserve(
int idx_count,
int vtx_count);
1238 IMGUI_API
void PrimRect(
const ImVec2& a,
const ImVec2& b, ImU32 col);
1241 inline void PrimWriteVtx(
const ImVec2& pos,
const ImVec2& uv, ImU32 col){ _VtxWritePtr->pos = pos; _VtxWritePtr->uv = uv; _VtxWritePtr->col = col; _VtxWritePtr++; _VtxCurrentIdx++; }
1242 inline void PrimWriteIdx(ImDrawIdx idx) { *_IdxWritePtr = idx; _IdxWritePtr++; }
1243 inline void PrimVtx(
const ImVec2& pos,
const ImVec2& uv, ImU32 col) { PrimWriteIdx((ImDrawIdx)_VtxCurrentIdx); PrimWriteVtx(pos, uv, col); }
1244 IMGUI_API
void UpdateClipRect();
1245 IMGUI_API
void UpdateTextureID();
1258 ImDrawData() { Valid =
false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
1259 IMGUI_API
void DeIndexAllBuffers();
1260 IMGUI_API
void ScaleClipRects(
const ImVec2& sc);
1267 bool FontDataOwnedByAtlas;
1270 int OversampleH, OversampleV;
1272 ImVec2 GlyphExtraSpacing;
1273 const ImWchar* GlyphRanges;
1275 bool MergeGlyphCenterV;
1296 IMGUI_API ~ImFontAtlas();
1299 IMGUI_API
ImFont* AddFontFromFileTTF(
const char* filename,
float size_pixels,
const ImFontConfig* font_cfg = NULL,
const ImWchar* glyph_ranges = NULL);
1300 IMGUI_API
ImFont* AddFontFromMemoryTTF(
void* ttf_data,
int ttf_size,
float size_pixels,
const ImFontConfig* font_cfg = NULL,
const ImWchar* glyph_ranges = NULL);
1301 IMGUI_API
ImFont* AddFontFromMemoryCompressedTTF(
const void* compressed_ttf_data,
int compressed_ttf_size,
float size_pixels,
const ImFontConfig* font_cfg = NULL,
const ImWchar* glyph_ranges = NULL);
1302 IMGUI_API
ImFont* AddFontFromMemoryCompressedBase85TTF(
const char* compressed_ttf_data_base85,
float size_pixels,
const ImFontConfig* font_cfg = NULL,
const ImWchar* glyph_ranges = NULL);
1303 IMGUI_API
void ClearTexData();
1304 IMGUI_API
void ClearInputData();
1305 IMGUI_API
void ClearFonts();
1306 IMGUI_API
void Clear();
1313 IMGUI_API
void GetTexDataAsAlpha8(
unsigned char** out_pixels,
int* out_width,
int* out_height,
int* out_bytes_per_pixel = NULL);
1314 IMGUI_API
void GetTexDataAsRGBA32(
unsigned char** out_pixels,
int* out_width,
int* out_height,
int* out_bytes_per_pixel = NULL);
1315 void SetTexID(
void*
id) { TexID = id; }
1319 IMGUI_API
const ImWchar* GetGlyphRangesDefault();
1320 IMGUI_API
const ImWchar* GetGlyphRangesKorean();
1321 IMGUI_API
const ImWchar* GetGlyphRangesJapanese();
1322 IMGUI_API
const ImWchar* GetGlyphRangesChinese();
1323 IMGUI_API
const ImWchar* GetGlyphRangesCyrillic();
1328 unsigned char* TexPixelsAlpha8;
1329 unsigned int* TexPixelsRGBA32;
1332 int TexDesiredWidth;
1338 IMGUI_API
bool Build();
1339 IMGUI_API
void RenderCustomTexData(
int pass,
void* rects);
1350 float X0, Y0, X1, Y1;
1351 float U0, V0, U1, V1;
1361 const Glyph* FallbackGlyph;
1362 float FallbackXAdvance;
1363 ImWchar FallbackChar;
1366 short ConfigDataCount;
1369 float Ascent, Descent;
1373 IMGUI_API ~ImFont();
1374 IMGUI_API
void Clear();
1375 IMGUI_API
void BuildLookupTable();
1376 IMGUI_API
const Glyph* FindGlyph(ImWchar c)
const;
1377 IMGUI_API
void SetFallbackChar(ImWchar c);
1378 float GetCharAdvance(ImWchar c)
const {
return ((
int)c < IndexXAdvance.Size) ? IndexXAdvance[(int)c] : FallbackXAdvance; }
1379 bool IsLoaded()
const {
return ContainerAtlas != NULL; }
1383 IMGUI_API
ImVec2 CalcTextSizeA(
float size,
float max_width,
float wrap_width,
const char* text_begin,
const char* text_end = NULL,
const char** remaining = NULL)
const;
1384 IMGUI_API
const char* CalcWordWrapPositionA(
float scale,
const char* text,
const char* text_end,
float wrap_width)
const;
1385 IMGUI_API
void RenderChar(
ImDrawList* draw_list,
float size,
ImVec2 pos, ImU32 col,
unsigned short c)
const;
1386 IMGUI_API
void RenderText(
ImDrawList* draw_list,
float size,
ImVec2 pos, ImU32 col,
const ImVec4& clip_rect,
const char* text_begin,
const char* text_end,
float wrap_width = 0.0f,
bool cpu_fine_clip =
false)
const;
1389 IMGUI_API
void GrowIndex(
int new_size);
1390 IMGUI_API
void AddRemapChar(ImWchar dst, ImWchar src,
bool overwrite_dst =
true);
1393 #if defined(__clang__) 1394 #pragma clang diagnostic pop 1400 #ifdef IMGUI_INCLUDE_IMGUI_USER_H 1401 #include "imgui_user.h"
constexpr auto end(const Sequence &sequence)
Returns an iterator pointing to the end of a sequence.
Definition: algorithm.hpp:86
constexpr auto begin(const Sequence &sequence)
Returns an iterator pointing to the beginning of a sequence.
Definition: algorithm.hpp:62
Definition: imgui-SFML.cpp:41
Definition: imgui_internal.h:344