|
|
|
|
1
|
-// ImGui library v1.37
|
|
|
|
|
1
|
+// ImGui library v1.38 WIP
|
2
|
// See .cpp file for documentation.
|
2
|
// See .cpp file for documentation.
|
3
|
// See ImGui::ShowTestWindow() for sample code.
|
3
|
// See ImGui::ShowTestWindow() for sample code.
|
4
|
// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
|
4
|
// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
|
|
|
|
|
13
|
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
|
13
|
#include <stdlib.h> // NULL, malloc, free, qsort, atoi
|
14
|
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
|
14
|
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
|
15
|
|
15
|
|
16
|
-#define IMGUI_VERSION "1.37"
|
|
|
|
|
16
|
+#define IMGUI_VERSION "1.38 WIP"
|
17
|
|
17
|
|
18
|
// Define assertion handler.
|
18
|
// Define assertion handler.
|
19
|
#ifndef IM_ASSERT
|
19
|
#ifndef IM_ASSERT
|
|
|
|
|
53
|
struct ImVec2
|
53
|
struct ImVec2
|
54
|
{
|
54
|
{
|
55
|
float x, y;
|
55
|
float x, y;
|
56
|
- ImVec2() {}
|
|
|
|
|
56
|
+ ImVec2() { x = y = 0.0f; }
|
57
|
ImVec2(float _x, float _y) { x = _x; y = _y; }
|
57
|
ImVec2(float _x, float _y) { x = _x; y = _y; }
|
58
|
|
58
|
|
59
|
-#ifdef IM_VEC2_CLASS_EXTRA
|
|
|
|
|
59
|
+#ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2.
|
60
|
IM_VEC2_CLASS_EXTRA
|
60
|
IM_VEC2_CLASS_EXTRA
|
61
|
#endif
|
61
|
#endif
|
62
|
};
|
62
|
};
|
|
|
|
|
64
|
struct ImVec4
|
64
|
struct ImVec4
|
65
|
{
|
65
|
{
|
66
|
float x, y, z, w;
|
66
|
float x, y, z, w;
|
67
|
- ImVec4() {}
|
|
|
|
|
67
|
+ ImVec4() { x = y = z = w = 0.0f; }
|
68
|
ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
|
68
|
ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
|
69
|
|
69
|
|
70
|
-#ifdef IM_VEC4_CLASS_EXTRA
|
|
|
|
|
70
|
+#ifdef IM_VEC4_CLASS_EXTRA // Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec4.
|
71
|
IM_VEC4_CLASS_EXTRA
|
71
|
IM_VEC4_CLASS_EXTRA
|
72
|
#endif
|
72
|
#endif
|
73
|
};
|
73
|
};
|
|
|
|
|
147
|
// - struct ImFont // TTF font loader, bake glyphs into bitmap
|
147
|
// - struct ImFont // TTF font loader, bake glyphs into bitmap
|
148
|
|
148
|
|
149
|
// ImGui end-user API
|
149
|
// ImGui end-user API
|
150
|
-// In a namespace so that user can add extra functions (e.g. Value() helpers for your vector or common types)
|
|
|
|
|
150
|
+// In a namespace so that user can add extra functions in a separate file (e.g. Value() helpers for your vector or common types)
|
151
|
namespace ImGui
|
151
|
namespace ImGui
|
152
|
{
|
152
|
{
|
153
|
// Main
|
153
|
// Main
|
|
|
|
|
156
|
IMGUI_API void NewFrame();
|
156
|
IMGUI_API void NewFrame();
|
157
|
IMGUI_API void Render();
|
157
|
IMGUI_API void Render();
|
158
|
IMGUI_API void Shutdown();
|
158
|
IMGUI_API void Shutdown();
|
159
|
- IMGUI_API void ShowUserGuide();
|
|
|
160
|
- IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL);
|
|
|
161
|
- IMGUI_API void ShowTestWindow(bool* open = NULL);
|
|
|
|
|
159
|
+ IMGUI_API void ShowUserGuide(); // help block
|
|
|
160
|
+ IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // style editor block
|
|
|
161
|
+ IMGUI_API void ShowTestWindow(bool* opened = NULL); // test window, demonstrate ImGui features
|
|
|
162
|
+ IMGUI_API void ShowMetricsWindow(bool* opened = NULL); // metrics window
|
162
|
|
163
|
|
163
|
// Window
|
164
|
// Window
|
164
|
// See implementation in .cpp for details
|
165
|
// See implementation in .cpp for details
|
|
|
|
|
191
|
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position - call within Begin()/End(). may incur tearing
|
192
|
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiSetCond cond = 0); // set named window position - call within Begin()/End(). may incur tearing
|
192
|
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
|
193
|
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiSetCond cond = 0); // set named window size. set to ImVec2(0,0) to force an auto-fit. may incur tearing
|
193
|
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0); // set named window collapsed state
|
194
|
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiSetCond cond = 0); // set named window collapsed state
|
194
|
- IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most
|
|
|
|
|
195
|
+ IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus.
|
195
|
|
196
|
|
196
|
IMGUI_API float GetScrollPosY(); // get scrolling position [0..GetScrollMaxY()]
|
197
|
IMGUI_API float GetScrollPosY(); // get scrolling position [0..GetScrollMaxY()]
|
197
|
IMGUI_API float GetScrollMaxY(); // get maximum scrolling position == ContentSize.Y - WindowSize.Y
|
198
|
IMGUI_API float GetScrollMaxY(); // get maximum scrolling position == ContentSize.Y - WindowSize.Y
|
|
|
|
|
259
|
// If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
|
260
|
// If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
|
260
|
// You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
|
261
|
// You can also use "##extra" within your widget name to distinguish them from each others (see 'Programmer Guide')
|
261
|
IMGUI_API void PushID(const char* str_id); // push identifier into the ID stack. IDs are hash of the *entire* stack!
|
262
|
IMGUI_API void PushID(const char* str_id); // push identifier into the ID stack. IDs are hash of the *entire* stack!
|
|
|
263
|
+ IMGUI_API void PushID(const char* str_id_begin, const char* str_id_end);
|
262
|
IMGUI_API void PushID(const void* ptr_id);
|
264
|
IMGUI_API void PushID(const void* ptr_id);
|
263
|
IMGUI_API void PushID(const int int_id);
|
265
|
IMGUI_API void PushID(const int int_id);
|
264
|
IMGUI_API void PopID();
|
266
|
IMGUI_API void PopID();
|
265
|
IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed
|
267
|
IMGUI_API ImGuiID GetID(const char* str_id); // calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed
|
|
|
268
|
+ IMGUI_API ImGuiID GetID(const char* str_id_begin, const char* str_id_end);
|
266
|
IMGUI_API ImGuiID GetID(const void* ptr_id);
|
269
|
IMGUI_API ImGuiID GetID(const void* ptr_id);
|
267
|
|
270
|
|
268
|
// Widgets
|
271
|
// Widgets
|
|
|
|
|
284
|
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));
|
287
|
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));
|
285
|
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,1), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding
|
288
|
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,1), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding
|
286
|
IMGUI_API bool CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false);
|
289
|
IMGUI_API bool CollapsingHeader(const char* label, const char* str_id = NULL, bool display_frame = true, bool default_open = false);
|
|
|
290
|
+ IMGUI_API bool Checkbox(const char* label, bool* v);
|
|
|
291
|
+ IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
|
|
|
292
|
+ IMGUI_API bool RadioButton(const char* label, bool active);
|
|
|
293
|
+ IMGUI_API bool RadioButton(const char* label, int* v, int v_button);
|
|
|
294
|
+ IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
|
|
295
|
+ IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items = -1); // separate items with \0, end item-list with \0\0
|
|
|
296
|
+ 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);
|
|
|
297
|
+ IMGUI_API bool ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
|
|
|
298
|
+ IMGUI_API bool ColorEdit3(const char* label, float col[3]);
|
|
|
299
|
+ IMGUI_API bool ColorEdit4(const char* label, float col[4], bool show_alpha = true);
|
|
|
300
|
+ IMGUI_API void ColorEditMode(ImGuiColorEditMode mode);
|
|
|
301
|
+ 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), size_t stride = sizeof(float));
|
|
|
302
|
+ 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));
|
|
|
303
|
+ 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), size_t stride = sizeof(float));
|
|
|
304
|
+ 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));
|
|
|
305
|
+
|
|
|
306
|
+ // Widgets: Sliders (tip: ctrl+click on a slider to input text)
|
287
|
IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders
|
307
|
IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f); // adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders
|
288
|
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);
|
308
|
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);
|
289
|
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);
|
309
|
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);
|
290
|
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);
|
310
|
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);
|
291
|
- IMGUI_API bool SliderAngle(const char* label, float* v, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f); // *v in radians
|
|
|
|
|
311
|
+ IMGUI_API bool SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);
|
292
|
IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
|
312
|
IMGUI_API bool SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
|
293
|
IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f");
|
313
|
IMGUI_API bool SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f");
|
294
|
IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
|
314
|
IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
|
295
|
IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
|
315
|
IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
|
296
|
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);
|
316
|
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);
|
297
|
IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
|
317
|
IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
|
298
|
- 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), size_t stride = sizeof(float));
|
|
|
299
|
- 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));
|
|
|
300
|
- 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), size_t stride = sizeof(float));
|
|
|
301
|
- 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));
|
|
|
302
|
- IMGUI_API bool Checkbox(const char* label, bool* v);
|
|
|
303
|
- IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
|
|
|
304
|
- IMGUI_API bool RadioButton(const char* label, bool active);
|
|
|
305
|
- IMGUI_API bool RadioButton(const char* label, int* v, int v_button);
|
|
|
|
|
318
|
+
|
|
|
319
|
+ // Widgets: Drags (tip: ctrl+click on a drag box to input text)
|
|
|
320
|
+ // ImGui 1.38+ work-in-progress, may change name or API.
|
|
|
321
|
+ 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); // If v_max >= v_max we have no bound
|
|
|
322
|
+ 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"); // If v_max >= v_max we have no bound
|
|
|
323
|
+
|
|
|
324
|
+ // Widgets: Input
|
306
|
IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
|
325
|
IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
|
307
|
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);
|
326
|
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);
|
308
|
IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision = -1);
|
327
|
IMGUI_API bool InputFloat2(const char* label, float v[2], int decimal_precision = -1);
|
|
|
|
|
312
|
IMGUI_API bool InputInt2(const char* label, int v[2]);
|
331
|
IMGUI_API bool InputInt2(const char* label, int v[2]);
|
313
|
IMGUI_API bool InputInt3(const char* label, int v[3]);
|
332
|
IMGUI_API bool InputInt3(const char* label, int v[3]);
|
314
|
IMGUI_API bool InputInt4(const char* label, int v[4]);
|
333
|
IMGUI_API bool InputInt4(const char* label, int v[4]);
|
315
|
- IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
|
|
316
|
- IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items = -1); // separate items with \0, end item-list with \0\0
|
|
|
317
|
- 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);
|
|
|
318
|
- IMGUI_API bool ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
|
|
|
319
|
- IMGUI_API bool ColorEdit3(const char* label, float col[3]);
|
|
|
320
|
- IMGUI_API bool ColorEdit4(const char* label, float col[4], bool show_alpha = true);
|
|
|
321
|
- IMGUI_API void ColorEditMode(ImGuiColorEditMode mode);
|
|
|
322
|
|
334
|
|
323
|
- // Trees
|
|
|
|
|
335
|
+ // Widgets: Trees
|
324
|
IMGUI_API bool TreeNode(const char* str_label_id); // if returning 'true' the node is open and the user is responsible for calling TreePop
|
336
|
IMGUI_API bool TreeNode(const char* str_label_id); // if returning 'true' the node is open and the user is responsible for calling TreePop
|
325
|
IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...); // "
|
337
|
IMGUI_API bool TreeNode(const char* str_id, const char* fmt, ...); // "
|
326
|
IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...); // "
|
338
|
IMGUI_API bool TreeNode(const void* ptr_id, const char* fmt, ...); // "
|
|
|
|
|
331
|
IMGUI_API void TreePop();
|
343
|
IMGUI_API void TreePop();
|
332
|
IMGUI_API void SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0); // set next tree node to be opened.
|
344
|
IMGUI_API void SetNextTreeNodeOpened(bool opened, ImGuiSetCond cond = 0); // set next tree node to be opened.
|
333
|
|
345
|
|
334
|
- // Selectable / Lists
|
|
|
|
|
346
|
+ // Widgets: Selectable / Lists
|
335
|
IMGUI_API bool Selectable(const char* label, bool selected = false, const ImVec2& size = ImVec2(0,0));
|
347
|
IMGUI_API bool Selectable(const char* label, bool selected = false, const ImVec2& size = ImVec2(0,0));
|
336
|
IMGUI_API bool Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
|
348
|
IMGUI_API bool Selectable(const char* label, bool* p_selected, const ImVec2& size = ImVec2(0,0));
|
337
|
IMGUI_API bool ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
349
|
IMGUI_API bool ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
|
|
|
|
340
|
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
|
352
|
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
|
341
|
IMGUI_API void ListBoxFooter(); // terminate the scrolling region
|
353
|
IMGUI_API void ListBoxFooter(); // terminate the scrolling region
|
342
|
|
354
|
|
343
|
- // Value() Helpers: output single value in "name: value" format. Tip: freely declare your own within the ImGui namespace!
|
|
|
|
|
355
|
+ // Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare your own within the ImGui namespace!)
|
344
|
IMGUI_API void Value(const char* prefix, bool b);
|
356
|
IMGUI_API void Value(const char* prefix, bool b);
|
345
|
IMGUI_API void Value(const char* prefix, int v);
|
357
|
IMGUI_API void Value(const char* prefix, int v);
|
346
|
IMGUI_API void Value(const char* prefix, unsigned int v);
|
358
|
IMGUI_API void Value(const char* prefix, unsigned int v);
|
|
|
|
|
348
|
IMGUI_API void Color(const char* prefix, const ImVec4& v);
|
360
|
IMGUI_API void Color(const char* prefix, const ImVec4& v);
|
349
|
IMGUI_API void Color(const char* prefix, unsigned int v);
|
361
|
IMGUI_API void Color(const char* prefix, unsigned int v);
|
350
|
|
362
|
|
351
|
- // Logging: All text output from your interface are redirected to tty/file/clipboard. Tree nodes are automatically opened.
|
|
|
|
|
363
|
+ // Logging: all text output from interface is redirected to tty/file/clipboard. Tree nodes are automatically opened.
|
352
|
IMGUI_API void LogToTTY(int max_depth = -1); // start logging to tty
|
364
|
IMGUI_API void LogToTTY(int max_depth = -1); // start logging to tty
|
353
|
IMGUI_API void LogToFile(int max_depth = -1, const char* filename = NULL); // start logging to file
|
365
|
IMGUI_API void LogToFile(int max_depth = -1, const char* filename = NULL); // start logging to file
|
354
|
IMGUI_API void LogToClipboard(int max_depth = -1); // start logging to OS clipboard
|
366
|
IMGUI_API void LogToClipboard(int max_depth = -1); // start logging to OS clipboard
|
|
|
|
|
361
|
IMGUI_API bool IsItemHoveredRect(); // was the last item hovered by mouse? even if another item is active while we are hovering this
|
373
|
IMGUI_API bool IsItemHoveredRect(); // was the last item hovered by mouse? even if another item is active while we are hovering this
|
362
|
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
374
|
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
363
|
IMGUI_API bool IsAnyItemActive(); //
|
375
|
IMGUI_API bool IsAnyItemActive(); //
|
364
|
- IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item
|
|
|
|
|
376
|
+ IMGUI_API bool IsItemVisible();
|
|
|
377
|
+ IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item in screen space
|
365
|
IMGUI_API ImVec2 GetItemRectMax(); // "
|
378
|
IMGUI_API ImVec2 GetItemRectMax(); // "
|
366
|
IMGUI_API ImVec2 GetItemRectSize(); // "
|
379
|
IMGUI_API ImVec2 GetItemRectSize(); // "
|
367
|
IMGUI_API bool IsWindowFocused(); // is current window focused (differentiate child windows from each others)
|
380
|
IMGUI_API bool IsWindowFocused(); // is current window focused (differentiate child windows from each others)
|
368
|
IMGUI_API bool IsRootWindowFocused(); // is current root window focused
|
381
|
IMGUI_API bool IsRootWindowFocused(); // is current root window focused
|
369
|
IMGUI_API bool IsRootWindowOrAnyChildFocused(); // is current root window or any of its child (including current window) focused
|
382
|
IMGUI_API bool IsRootWindowOrAnyChildFocused(); // is current root window or any of its child (including current window) focused
|
370
|
- IMGUI_API bool IsClipped(const ImVec2& item_size); // to perform coarse clipping on user's side (as an optimization)
|
|
|
|
|
383
|
+ IMGUI_API bool IsRectClipped(const ImVec2& size); // test if rectangle of given size starting from cursor pos is out of clipping region. to perform coarse clipping on user's side (as an optimization)
|
371
|
IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
|
384
|
IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
|
372
|
IMGUI_API bool IsMouseClicked(int button, bool repeat = false);
|
385
|
IMGUI_API bool IsMouseClicked(int button, bool repeat = false);
|
373
|
IMGUI_API bool IsMouseDoubleClicked(int button);
|
386
|
IMGUI_API bool IsMouseDoubleClicked(int button);
|
|
|
|
|
378
|
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
|
391
|
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
|
379
|
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
392
|
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
380
|
IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking, also see: GetItemActiveDragDelta(). if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
393
|
IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking, also see: GetItemActiveDragDelta(). if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
|
|
394
|
+ IMGUI_API void ResetMouseDragDelta(int button = 0);
|
381
|
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
395
|
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
382
|
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
|
396
|
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
|
383
|
IMGUI_API float GetTime();
|
397
|
IMGUI_API float GetTime();
|
|
|
|
|
406
|
static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); } // OBSOLETE
|
420
|
static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); } // OBSOLETE
|
407
|
static inline ImVec2 GetItemBoxMin() { return GetItemRectMin(); } // OBSOLETE
|
421
|
static inline ImVec2 GetItemBoxMin() { return GetItemRectMin(); } // OBSOLETE
|
408
|
static inline ImVec2 GetItemBoxMax() { return GetItemRectMax(); } // OBSOLETE
|
422
|
static inline ImVec2 GetItemBoxMax() { return GetItemRectMax(); } // OBSOLETE
|
|
|
423
|
+ static inline bool IsClipped(const ImVec2& size) { return IsRectClipped(size); } // OBSOLETE
|
409
|
static inline bool IsMouseHoveringBox(const ImVec2& rect_min, const ImVec2& rect_max) { return IsMouseHoveringRect(rect_min, rect_max); } // OBSOLETE
|
424
|
static inline bool IsMouseHoveringBox(const ImVec2& rect_min, const ImVec2& rect_max) { return IsMouseHoveringRect(rect_min, rect_max); } // OBSOLETE
|
410
|
|
425
|
|
411
|
} // namespace ImGui
|
426
|
} // namespace ImGui
|
|
|
|
|
480
|
ImGuiCol_Border,
|
495
|
ImGuiCol_Border,
|
481
|
ImGuiCol_BorderShadow,
|
496
|
ImGuiCol_BorderShadow,
|
482
|
ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input
|
497
|
ImGuiCol_FrameBg, // Background of checkbox, radio button, plot, slider, text input
|
|
|
498
|
+ ImGuiCol_FrameBgHovered,
|
|
|
499
|
+ ImGuiCol_FrameBgActive,
|
483
|
ImGuiCol_TitleBg,
|
500
|
ImGuiCol_TitleBg,
|
484
|
ImGuiCol_TitleBgCollapsed,
|
501
|
ImGuiCol_TitleBgCollapsed,
|
485
|
ImGuiCol_ScrollbarBg,
|
502
|
ImGuiCol_ScrollbarBg,
|
|
|
|
|
487
|
ImGuiCol_ScrollbarGrabHovered,
|
504
|
ImGuiCol_ScrollbarGrabHovered,
|
488
|
ImGuiCol_ScrollbarGrabActive,
|
505
|
ImGuiCol_ScrollbarGrabActive,
|
489
|
ImGuiCol_ComboBg,
|
506
|
ImGuiCol_ComboBg,
|
490
|
- ImGuiCol_CheckHovered,
|
|
|
491
|
- ImGuiCol_CheckActive,
|
|
|
492
|
ImGuiCol_CheckMark,
|
507
|
ImGuiCol_CheckMark,
|
493
|
ImGuiCol_SliderGrab,
|
508
|
ImGuiCol_SliderGrab,
|
494
|
ImGuiCol_SliderGrabActive,
|
509
|
ImGuiCol_SliderGrabActive,
|
|
|
|
|
546
|
enum ImGuiMouseCursor_
|
561
|
enum ImGuiMouseCursor_
|
547
|
{
|
562
|
{
|
548
|
ImGuiMouseCursor_Arrow = 0,
|
563
|
ImGuiMouseCursor_Arrow = 0,
|
549
|
- ImGuiMouseCursor_TextInput,
|
|
|
550
|
- ImGuiMouseCursor_Move, // Unused by ImGui
|
|
|
551
|
- ImGuiMouseCursor_ResizeNS, // Unused by ImGui
|
|
|
552
|
- ImGuiMouseCursor_ResizeEW, // Unused by ImGui
|
|
|
553
|
- ImGuiMouseCursor_ResizeNESW, // Unused by ImGui
|
|
|
554
|
- ImGuiMouseCursor_ResizeNWSE,
|
|
|
|
|
564
|
+ ImGuiMouseCursor_TextInput, // When hovering over InputText, etc.
|
|
|
565
|
+ ImGuiMouseCursor_Move, // Unused
|
|
|
566
|
+ ImGuiMouseCursor_ResizeNS, // Unused
|
|
|
567
|
+ ImGuiMouseCursor_ResizeEW, // When hovering over a column
|
|
|
568
|
+ ImGuiMouseCursor_ResizeNESW, // Unused
|
|
|
569
|
+ ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window
|
555
|
ImGuiMouseCursor_Count_
|
570
|
ImGuiMouseCursor_Count_
|
556
|
};
|
571
|
};
|
557
|
|
572
|
|
|
|
|
|
660
|
bool WantCaptureMouse; // Mouse is hovering a window or widget is active (= ImGui will use your mouse input)
|
675
|
bool WantCaptureMouse; // Mouse is hovering a window or widget is active (= ImGui will use your mouse input)
|
661
|
bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input)
|
676
|
bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input)
|
662
|
float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames
|
677
|
float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames
|
|
|
678
|
+ int MetricsRenderVertices; // Vertices processed during last call to Render()
|
663
|
|
679
|
|
664
|
//------------------------------------------------------------------
|
680
|
//------------------------------------------------------------------
|
665
|
// [Internal] ImGui will maintain those fields for you
|
681
|
// [Internal] ImGui will maintain those fields for you
|
|
|
|
|
873
|
// At the moment, each ImGui window contains its own ImDrawList but they could potentially be merged in the future.
|
889
|
// At the moment, each ImGui window contains its own ImDrawList but they could potentially be merged in the future.
|
874
|
// If you want to add custom rendering within a window, you can use ImGui::GetWindowDrawList() to access the current draw list and add your own primitives.
|
890
|
// If you want to add custom rendering within a window, you can use ImGui::GetWindowDrawList() to access the current draw list and add your own primitives.
|
875
|
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
|
891
|
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
|
|
|
892
|
+// All positions are in screen coordinates (0,0=top-left, 1 pixel per unit). Primitives are always added to the list and not culled (culling is done at render time and at a higher-level by ImGui:: functions).
|
876
|
// Note that this only gives you access to rendering polygons. If your intent is to create custom widgets and the publicly exposed functions/data aren't sufficient, you can add code in imgui_user.inl
|
893
|
// Note that this only gives you access to rendering polygons. If your intent is to create custom widgets and the publicly exposed functions/data aren't sufficient, you can add code in imgui_user.inl
|
877
|
struct ImDrawList
|
894
|
struct ImDrawList
|
878
|
{
|
895
|
{
|
|
|
|
|
896
|
|
913
|
|
897
|
// Primitives
|
914
|
// Primitives
|
898
|
IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);
|
915
|
IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);
|
899
|
- IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
|
|
|
900
|
- IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
|
|
|
|
|
916
|
+ IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners = 0x0F);
|
|
|
917
|
+ IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners = 0x0F);
|
901
|
IMGUI_API void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
|
918
|
IMGUI_API void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
|
902
|
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
919
|
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
903
|
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
920
|
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
904
|
- IMGUI_API void AddArc(const ImVec2& center, float rad, ImU32 col, int a_min, int a_max, bool tris = false, const ImVec2& third_point_offset = ImVec2(0,0));
|
|
|
|
|
921
|
+ IMGUI_API void AddArcFast(const ImVec2& center, float radius, ImU32 col, int a_min_12, int a_max_12, bool filled = false, const ImVec2& third_point_offset = ImVec2(0,0)); // Angles in 0..12 range
|
905
|
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 ImVec2* cpu_clip_max = NULL);
|
922
|
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 ImVec2* cpu_clip_max = NULL);
|
906
|
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
|
923
|
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
|
907
|
|
924
|
|
908
|
// Advanced
|
925
|
// Advanced
|
909
|
- IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'user_callback' in ImDrawCmd and call the function instead of rendering triangles.
|
|
|
910
|
- IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
|
|
|
|
|
926
|
+ IMGUI_API void AddCallback(ImDrawCallback callback, void* callback_data); // Your rendering function must check for 'user_callback' in ImDrawCmd and call the function instead of rendering triangles.
|
|
|
927
|
+ IMGUI_API void AddDrawCmd(); // This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
|
911
|
|
928
|
|
912
|
// Internal helpers
|
929
|
// Internal helpers
|
913
|
- IMGUI_API void ReserveVertices(unsigned int vtx_count);
|
|
|
914
|
- IMGUI_API void AddVtx(const ImVec2& pos, ImU32 col);
|
|
|
915
|
- IMGUI_API void AddVtxUV(const ImVec2& pos, ImU32 col, const ImVec2& uv);
|
|
|
916
|
- IMGUI_API void AddVtxLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);
|
|
|
|
|
930
|
+ IMGUI_API void PrimReserve(unsigned int vtx_count);
|
|
|
931
|
+ IMGUI_API void PrimTriangle(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
|
|
|
932
|
+ IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col);
|
|
|
933
|
+ IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
|
|
|
934
|
+ IMGUI_API void PrimQuad(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, ImU32 col);
|
|
|
935
|
+ IMGUI_API void PrimLine(const ImVec2& a, const ImVec2& b, ImU32 col, float thickness = 1.0f);
|
917
|
IMGUI_API void UpdateClipRect();
|
936
|
IMGUI_API void UpdateClipRect();
|
918
|
IMGUI_API void UpdateTextureID();
|
937
|
IMGUI_API void UpdateTextureID();
|
|
|
938
|
+ IMGUI_API void PrimVtx(const ImVec2& pos, const ImVec2& uv, ImU32 col) { vtx_write->pos = pos; vtx_write->uv = uv; vtx_write->col = col; vtx_write++; }
|
919
|
};
|
939
|
};
|
920
|
|
940
|
|
921
|
// Load and rasterize multiple TTF fonts into a same texture.
|
941
|
// Load and rasterize multiple TTF fonts into a same texture.
|
|
|
|
|
925
|
// 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
|
945
|
// 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
|
926
|
// 3. Upload the pixels data into a texture within your graphics system.
|
946
|
// 3. Upload the pixels data into a texture within your graphics system.
|
927
|
// 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture.
|
947
|
// 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture.
|
928
|
-// 5. Call ClearPixelsData() to free textures memory on the heap.
|
|
|
|
|
948
|
+// 5. Call ClearTexData() to free textures memory on the heap.
|
929
|
struct ImFontAtlas
|
949
|
struct ImFontAtlas
|
930
|
{
|
950
|
{
|
931
|
IMGUI_API ImFontAtlas();
|
951
|
IMGUI_API ImFontAtlas();
|
932
|
IMGUI_API ~ImFontAtlas();
|
952
|
IMGUI_API ~ImFontAtlas();
|
933
|
IMGUI_API ImFont* AddFontDefault();
|
953
|
IMGUI_API ImFont* AddFontDefault();
|
934
|
IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0);
|
954
|
IMGUI_API ImFont* AddFontFromFileTTF(const char* filename, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0);
|
935
|
- IMGUI_API ImFont* AddFontFromMemoryTTF(void* in_ttf_data, size_t in_ttf_data_size, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0); // Pass ownership of 'in_ttf_data' memory.
|
|
|
|
|
955
|
+ IMGUI_API ImFont* AddFontFromMemoryTTF(void* in_ttf_data, unsigned int in_ttf_data_size, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0); // Pass ownership of 'in_ttf_data' memory, will be deleted after build
|
|
|
956
|
+ IMGUI_API ImFont* AddFontFromMemoryCompressedTTF(const void* in_compressed_ttf_data, unsigned int in_compressed_ttf_data_size, float size_pixels, const ImWchar* glyph_ranges = NULL, int font_no = 0); // 'in_compressed_ttf_data' untouched and still owned by caller. compress with binary_to_compressed_c.
|
936
|
IMGUI_API void ClearTexData(); // Saves RAM once the texture has been copied to graphics memory.
|
957
|
IMGUI_API void ClearTexData(); // Saves RAM once the texture has been copied to graphics memory.
|
937
|
IMGUI_API void Clear();
|
958
|
IMGUI_API void Clear();
|
938
|
|
959
|
|
|
|
|
|
998
|
|
1019
|
|
999
|
// Methods
|
1020
|
// Methods
|
1000
|
IMGUI_API ImFont();
|
1021
|
IMGUI_API ImFont();
|
1001
|
- IMGUI_API ~ImFont() { Clear(); }
|
|
|
1002
|
- IMGUI_API void Clear();
|
|
|
1003
|
- IMGUI_API void BuildLookupTable();
|
|
|
1004
|
- IMGUI_API const Glyph* FindGlyph(unsigned short c) const;
|
|
|
1005
|
- IMGUI_API void SetFallbackChar(ImWchar c);
|
|
|
1006
|
- IMGUI_API bool IsLoaded() const { return ContainerAtlas != NULL; }
|
|
|
|
|
1022
|
+ IMGUI_API ~ImFont();
|
|
|
1023
|
+ IMGUI_API void Clear();
|
|
|
1024
|
+ IMGUI_API void BuildLookupTable();
|
|
|
1025
|
+ IMGUI_API const Glyph* FindGlyph(unsigned short c) const;
|
|
|
1026
|
+ IMGUI_API void SetFallbackChar(ImWchar c);
|
|
|
1027
|
+ IMGUI_API bool IsLoaded() const { return ContainerAtlas != NULL; }
|
1007
|
|
1028
|
|
1008
|
// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
1029
|
// 'max_width' stops rendering after a certain width (could be turned into a 2d size). FLT_MAX to disable.
|
1009
|
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
1030
|
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
|
1010
|
- 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; // utf8
|
|
|
1011
|
- IMGUI_API ImVec2 CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const; // wchar
|
|
|
1012
|
- IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawVert*& out_vertices, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL) const;
|
|
|
1013
|
- IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
|
|
|
|
|
1031
|
+ 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; // utf8
|
|
|
1032
|
+ IMGUI_API ImVec2 CalcTextSizeW(float size, float max_width, const ImWchar* text_begin, const ImWchar* text_end, const ImWchar** remaining = NULL) const; // wchar
|
|
|
1033
|
+ IMGUI_API void RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, ImDrawList* draw_list, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL) const;
|
|
|
1034
|
+ IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
|
1014
|
};
|
1035
|
};
|
1015
|
|
1036
|
|
1016
|
//---- Include imgui_user.h at the end of imgui.h
|
1037
|
//---- Include imgui_user.h at the end of imgui.h
|