Go to the documentation of this file.
63 #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS)
64 #define _CRT_SECURE_NO_WARNINGS
75 #if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
82 #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
84 #if defined(__clang__)
85 #pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse.
86 #pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code)
87 #pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
88 #pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal
89 #pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
90 #pragma clang diagnostic ignored "-Wunused-macros" // warning : warning: macro is not used // we define snprintf/vsnprintf on Windows so they are available, but not always used.
91 #if __has_warning("-Wzero-as-null-pointer-constant")
92 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" // warning : zero as null pointer constant // some standard header variations use #define NULL 0
94 #if __has_warning("-Wdouble-promotion")
95 #pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
97 #if __has_warning("-Wreserved-id-macro")
98 #pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
100 #elif defined(__GNUC__)
101 #pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
102 #pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
103 #pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure)
104 #pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
105 #pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
106 #pragma GCC diagnostic ignored "-Wmisleading-indentation" // [__GNUC__ >= 6] warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub.
111 #define IM_NEWLINE "\r\n"
113 #define IM_NEWLINE "\n"
116 #if defined(_MSC_VER) && !defined(snprintf)
117 #define snprintf _snprintf
119 #if defined(_MSC_VER) && !defined(vsnprintf)
120 #define vsnprintf _vsnprintf
127 #if !defined(IMGUI_DISABLE_DEMO_WINDOWS)
164 ImGui::BulletText(
"Click and drag on lower corner to resize window\n(double-click to auto fit window to its contents).");
176 ImGui::BulletText(
"You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
183 ImGui::BulletText(
"Escape to deactivate a widget, close popup, exit child window.");
213 static bool show_app_documents =
false;
214 static bool show_app_main_menu_bar =
false;
215 static bool show_app_console =
false;
216 static bool show_app_log =
false;
217 static bool show_app_layout =
false;
218 static bool show_app_property_editor =
false;
219 static bool show_app_long_text =
false;
220 static bool show_app_auto_resize =
false;
221 static bool show_app_constrained_resize =
false;
222 static bool show_app_simple_overlay =
false;
223 static bool show_app_window_titles =
false;
224 static bool show_app_custom_rendering =
false;
240 static bool show_app_metrics =
false;
241 static bool show_app_style_editor =
false;
242 static bool show_app_about =
false;
249 static bool no_titlebar =
false;
250 static bool no_scrollbar =
false;
251 static bool no_menu =
false;
252 static bool no_move =
false;
253 static bool no_resize =
false;
254 static bool no_collapse =
false;
255 static bool no_close =
false;
256 static bool no_nav =
false;
257 static bool no_background =
false;
258 static bool no_bring_to_front =
false;
270 if (no_close) p_open =
NULL;
277 if (!
ImGui::Begin(
"Dear ImGui Demo", p_open, window_flags))
328 ImGui::BulletText(
"Sections below are demonstrating many aspects of the library.");
330 ImGui::BulletText(
"The \"Tools\" menu above gives access to: About Box, Style Editor,\n"
331 "and Metrics (general purpose Dear ImGui debugging tool).");
335 ImGui::BulletText(
"See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
339 ImGui::BulletText(
"Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
340 ImGui::BulletText(
"Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
355 ImGui::SameLine();
HelpMarker(
"Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
357 ImGui::SameLine();
HelpMarker(
"Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.");
374 ImGui::SameLine();
HelpMarker(
"Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
377 ImGui::SameLine();
HelpMarker(
"Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
384 HelpMarker(
"Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities.\nHere we expose then as read-only fields to avoid breaking interactions with your back-end.");
396 HelpMarker(
"The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function.");
404 ImGui::TextWrapped(
"The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded.");
405 HelpMarker(
"Try opening any of the contents below in this window and then click one of the \"Log To\" button.");
407 ImGui::TextWrapped(
"You can also call ImGui::LogText() to output directly to the log without a visual output.");
450 static int clicked = 0;
459 static bool check =
true;
468 for (
int i = 0;
i < 7;
i++)
487 static int counter = 0;
507 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
519 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD",
"EEEE",
"FFFF",
"GGGG",
"HHHH",
"IIII",
"JJJJ",
"KKKK",
"LLLLLLL",
"MMMM",
"OOOOOOO" };
520 static int item_current = 0;
522 ImGui::SameLine();
HelpMarker(
"Refer to the \"Combo\" section below for an explanation of the full BeginCombo/EndCombo API, and demonstration of various flags.\n");
528 static char str0[128] =
"Hello, world!";
530 ImGui::SameLine();
HelpMarker(
"USER:\nHold SHIFT or use mouse to select text.\n" "CTRL+Left/Right to word jump.\n" "CTRL+A or double-click to select all.\n" "CTRL+X,CTRL+C,CTRL+V clipboard.\n" "CTRL+Z,CTRL+Y undo/redo.\n" "ESCAPE to revert.\n\nPROGRAMMER:\nYou can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputText() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example (this is not demonstrated in imgui_demo.cpp).");
532 static char str1[128] =
"";
537 ImGui::SameLine();
HelpMarker(
"You can apply arithmetic operators +,*,/ on numerical values.\n e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\nUse +- to subtract.\n");
539 static float f0 = 0.001f;
542 static double d0 = 999999.00000001;
545 static float f1 = 1.e10f;
547 ImGui::SameLine();
HelpMarker(
"You can input value using the scientific notation,\n e.g. \"1e+8\" becomes \"100000000\".\n");
549 static float vec4a[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
554 static int i1 = 50, i2 = 42;
556 ImGui::SameLine();
HelpMarker(
"Click and drag to edit value.\nHold SHIFT/ALT for faster/slower edit.\nDouble-click or CTRL+click to input value.");
560 static float f1=1.00f, f2=0.0067f;
570 static float f1=0.123f, f2=0.0f;
574 static float angle = 0.0f;
580 enum Element { Element_Fire, Element_Earth, Element_Air, Element_Water, Element_COUNT };
581 const char* element_names[Element_COUNT] = {
"Fire",
"Earth",
"Air",
"Water" };
582 static int current_element = Element_Fire;
583 const char* current_element_name = (current_element >= 0 && current_element < Element_COUNT) ? element_names[current_element] :
"Unknown";
584 ImGui::SliderInt(
"slider enum", ¤t_element, 0, Element_COUNT - 1, current_element_name);
589 static float col1[3] = { 1.0f,0.0f,0.2f };
590 static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
592 ImGui::SameLine();
HelpMarker(
"Click on the colored square to open a color picker.\nClick and hold to use drag and drop.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
599 const char* listbox_items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi",
"Mango",
"Orange",
"Pineapple",
"Strawberry",
"Watermelon" };
600 static int listbox_item_current = 1;
621 for (
int i = 0;
i < 5;
i++)
641 HelpMarker(
"This is a more typical looking tree with selectable nodes.\nClick to select, CTRL+Click to toggle, click on arrows or double-click to open.");
643 static bool align_label_with_current_x_position =
false;
648 ImGui::Checkbox(
"Align label with current X position", &align_label_with_current_x_position);
650 if (align_label_with_current_x_position)
653 static int selection_mask = (1 << 2);
654 int node_clicked = -1;
655 for (
int i = 0;
i < 6;
i++)
659 const bool is_selected = (selection_mask & (1 <<
i)) != 0;
665 bool node_open =
ImGui::TreeNodeEx((
void*)(intptr_t)
i, node_flags,
"Selectable Node %d",
i);
685 if (node_clicked != -1)
689 selection_mask ^= (1 << node_clicked);
691 selection_mask = (1 << node_clicked);
693 if (align_label_with_current_x_position)
702 static bool closable_group =
true;
707 for (
int i = 0;
i < 5;
i++)
713 for (
int i = 0;
i < 5;
i++)
752 ImGui::TextWrapped(
"This text should automatically wrap on the edge of the window. The current implementation for text wrapping follows simple rules suitable for English and possibly other languages.");
755 static float wrap_width = 200.0f;
762 ImGui::Text(
"The lazy dog is a good dog. This paragraph is made to fit within %.0f pixels. Testing a 1 character word. The quick brown fox jumps over the lazy dog.", wrap_width);
770 ImGui::Text(
"aaaaaaaa bbbbbbbb, c cccccccc,dddddddd. d eeeeeeee ffffffff. gggggggg!hhhhhhhh");
787 ImGui::TextWrapped(
"CJK text will only appears if the font was loaded with the appropriate CJK character ranges. Call io.Font->AddFontFromFileTTF() manually to load extra character ranges. Read docs/FONTS.txt for details.");
788 ImGui::Text(
"Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)");
789 ImGui::Text(
"Kanjis: \xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e (nihongo)");
790 static char buf[32] =
"\xe6\x97\xa5\xe6\x9c\xac\xe8\xaa\x9e";
801 ImGui::TextWrapped(
"Below we are displaying the font texture (which is the only texture we have access to in this demo). Use the 'ImTextureID' type as storage to pass pointers or identifier to your own texture data. Hover the texture for a zoomed view!");
816 ImGui::Image(my_tex_id,
ImVec2(my_tex_w, my_tex_h),
ImVec2(0,0),
ImVec2(1,1),
ImVec4(1.0
f,1.0
f,1.0
f,1.0
f),
ImVec4(1.0
f,1.0
f,1.0
f,0.5
f));
820 float region_sz = 32.0f;
821 float region_x = io.
MousePos.
x - pos.
x - region_sz * 0.5f;
if (region_x < 0.0
f) region_x = 0.0f;
else if (region_x > my_tex_w - region_sz) region_x = my_tex_w - region_sz;
822 float region_y = io.
MousePos.
y - pos.
y - region_sz * 0.5f;
if (region_y < 0.0
f) region_y = 0.0f;
else if (region_y > my_tex_h - region_sz) region_y = my_tex_h - region_sz;
824 ImGui::Text(
"Min: (%.2f, %.2f)", region_x, region_y);
825 ImGui::Text(
"Max: (%.2f, %.2f)", region_x + region_sz, region_y + region_sz);
826 ImVec2 uv0 =
ImVec2((region_x) / my_tex_w, (region_y) / my_tex_h);
827 ImVec2 uv1 =
ImVec2((region_x + region_sz) / my_tex_w, (region_y + region_sz) / my_tex_h);
828 ImGui::Image(my_tex_id,
ImVec2(region_sz * zoom, region_sz * zoom), uv0, uv1,
ImVec4(1.0
f, 1.0
f, 1.0
f, 1.0
f),
ImVec4(1.0
f, 1.0
f, 1.0
f, 0.5
f));
832 static int pressed_count = 0;
833 for (
int i = 0;
i < 8;
i++)
836 int frame_padding = -1 +
i;
837 if (
ImGui::ImageButton(my_tex_id,
ImVec2(32,32),
ImVec2(0,0),
ImVec2(32.0
f/my_tex_w,32/my_tex_h), frame_padding,
ImVec4(0.0
f,0.0
f,0.0
f,1.0
f)))
860 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD",
"EEEE",
"FFFF",
"GGGG",
"HHHH",
"IIII",
"JJJJ",
"KKKK",
"LLLLLLL",
"MMMM",
"OOOOOOO" };
861 static const char* item_current = items[0];
866 bool is_selected = (item_current == items[
n]);
868 item_current = items[
n];
876 static int item_current_2 = 0;
877 ImGui::Combo(
"combo 2 (one-liner)", &item_current_2,
"aaaa\0bbbb\0cccc\0dddd\0eeee\0\0");
880 static int item_current_3 = -1;
884 struct FuncHolder {
static bool ItemGetter(
void*
data,
int idx,
const char** out_str) { *out_str = ((
const char**)
data)[
idx];
return true; } };
885 static int item_current_4 = 0;
899 static bool selection[5] = {
false,
true,
false,
false,
false };
906 selection[4] = !selection[4];
911 static int selected = -1;
912 for (
int n = 0;
n < 5;
n++)
915 sprintf(
buf,
"Object %d",
n);
923 HelpMarker(
"Hold CTRL and click to select multiple items.");
924 static bool selection[5] = {
false,
false,
false,
false,
false };
925 for (
int n = 0;
n < 5;
n++)
928 sprintf(
buf,
"Object %d",
n);
932 memset(selection, 0,
sizeof(selection));
941 static bool selected[3] = {
false,
false,
false };
950 static bool selected[16] = {};
951 for (
int i = 0;
i < 16;
i++)
962 static bool selected[4*4] = {
true,
false,
false,
false,
false,
true,
false,
false,
false,
false,
true,
false,
false,
false,
false,
true };
963 for (
int i = 0;
i < 4*4;
i++)
971 if (
x > 0) { selected[
i - 1] ^= 1; }
972 if (
x < 3 &&
i < 15) { selected[
i + 1] ^= 1; }
973 if (
y > 0 &&
i > 3) { selected[
i - 4] ^= 1; }
974 if (
y < 3 &&
i < 12) { selected[
i + 4] ^= 1; }
983 HelpMarker(
"By default, Selectables uses style.SelectableTextAlign but it can be overriden on a per-item basis using PushStyleVar(). You'll probably want to always keep your default situation to left-align otherwise it becomes difficult to layout multiple items on a same line");
984 static bool selected[3*3] = {
true,
false,
true,
false,
true,
false,
true,
false,
true };
985 for (
int y = 0;
y < 3;
y++)
987 for (
int x = 0;
x < 3;
x++)
991 sprintf(
name,
"(%.1f,%.1f)", alignment.
x, alignment.
y);
1011 static char text[1024 * 16] =
1013 " The Pentium F00F bug, shorthand for F0 0F C7 C8,\n"
1014 " the hexadecimal encoding of one offending instruction,\n"
1015 " more formally, the invalid operand with locked CMPXCHG8B\n"
1016 " instruction bug, is a design flaw in the majority of\n"
1017 " Intel Pentium, Pentium MMX, and Pentium OverDrive\n"
1018 " processors (all in the P5 microarchitecture).\n"
1021 "\tlock cmpxchg8b eax\n";
1024 HelpMarker(
"You can use the ImGuiInputTextFlags_CallbackResize facility if you need to wire InputTextMultiline() to a dynamic string type. See misc/cpp/imgui_stdlib.h for an example. (This is not demonstrated in imgui_demo.cpp because we don't want to include <string> in here)");
1043 static char password[64] =
"password123";
1056 HelpMarker(
"Demonstrate using ImGuiInputTextFlags_CallbackResize to wire your resizable string type to InputText().\n\nSee misc/cpp/imgui_stdlib.h for an implementation of this for std::string.");
1097 static bool animate =
true;
1100 static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
1105 static float values[90] = {};
1106 static int values_offset = 0;
1107 static double refresh_time = 0.0;
1108 if (!animate || refresh_time == 0.0)
1112 static float phase = 0.0f;
1113 values[values_offset] = cosf(phase);
1115 phase += 0.10f*values_offset;
1116 refresh_time += 1.0f/60.0f;
1122 float average = 0.0f;
1127 sprintf(overlay,
"avg %f", average);
1136 static float Sin(
void*,
int i) {
return sinf(
i * 0.1
f); }
1137 static float Saw(
void*,
int i) {
return (
i & 1) ? 1.0f : -1.0f; }
1139 static int func_type = 0, display_count = 70;
1145 float (*
func)(
void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
1151 static float progress = 0.0f, progress_dir = 1.0f;
1155 if (progress >= +1.1
f) { progress = +1.1f; progress_dir *= -1.0f; }
1156 if (progress <= -0.1
f) { progress = -0.1f; progress_dir *= -1.0f; }
1165 float progress_saturated = (progress < 0.0f) ? 0.0
f : (progress > 1.0
f) ? 1.0f : progress;
1167 sprintf(
buf,
"%d/%d", (
int)(progress_saturated*1753), 1753);
1176 static bool alpha_preview =
true;
1177 static bool alpha_half_preview =
false;
1178 static bool drag_and_drop =
true;
1179 static bool options_menu =
true;
1180 static bool hdr =
false;
1189 ImGui::SameLine();
HelpMarker(
"Click on the colored square to open a color picker.\nCTRL+click on individual component to input value.\n");
1199 ImGui::SameLine();
HelpMarker(
"With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup.");
1202 ImGui::Text(
"Color button with Custom Picker Popup:");
1205 static bool saved_palette_init =
true;
1206 static ImVec4 saved_palette[32] = {};
1207 if (saved_palette_init)
1212 saved_palette[
n].
w = 1.0f;
1214 saved_palette_init =
false;
1217 static ImVec4 backup_color;
1224 backup_color =
color;
1228 ImGui::Text(
"MY CUSTOM COLOR PICKER WITH AN AMAZING PALETTE!");
1238 color = backup_color;
1254 memcpy((
float*)&saved_palette[
n], payload->Data,
sizeof(
float) * 3);
1256 memcpy((
float*)&saved_palette[
n], payload->Data,
sizeof(
float) * 4);
1267 static bool no_border =
false;
1272 static bool alpha =
true;
1273 static bool alpha_bar =
true;
1274 static bool side_preview =
true;
1275 static bool ref_color =
false;
1276 static ImVec4 ref_color_v(1.0
f,0.0
f,1.0
f,0.5
f);
1277 static int display_mode = 0;
1278 static int picker_mode = 0;
1292 ImGui::Combo(
"Display Mode", &display_mode,
"Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0");
1293 ImGui::SameLine();
HelpMarker(
"ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, but the user can change it with a right-click.\n\nColorPicker defaults to displaying RGB+HSV+Hex if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions().");
1294 ImGui::Combo(
"Picker Mode", &picker_mode,
"Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0");
1309 ImGui::SameLine();
HelpMarker(
"SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible.");
1316 static ImVec4 color_stored_as_hsv(0.23
f, 1.0
f, 1.0
f, 1.0
f);
1319 ImGui::SameLine();
HelpMarker(
"By default, colors are given to ColorEdit and ColorPicker in RGB, but ImGuiColorEditFlags_InputHSV allows you to store colors as HSV and pass them to ColorEdit and ColorPicker as HSV. This comes with the added benefit that you can manipulate hue values with the picker even when saturation or value are zero.");
1331 static int begin_i = 100, end_i = 1000;
1333 ImGui::DragIntRange2(
"range int (no bounds)", &begin_i, &end_i, 5, 0, 0,
"Min: %d units",
"Max: %d units");
1354 ImS64 LLONG_MIN = -9223372036854775807
LL - 1;
1355 ImS64 LLONG_MAX = 9223372036854775807
LL;
1356 ImU64 ULLONG_MAX = (2
ULL * 9223372036854775807
LL + 1);
1358 const char s8_zero = 0, s8_one = 1, s8_fifty = 50, s8_min = -128, s8_max = 127;
1359 const ImU8 u8_zero = 0, u8_one = 1, u8_fifty = 50, u8_min = 0, u8_max = 255;
1360 const short s16_zero = 0, s16_one = 1, s16_fifty = 50, s16_min = -32768, s16_max = 32767;
1361 const ImU16 u16_zero = 0, u16_one = 1, u16_fifty = 50, u16_min = 0, u16_max = 65535;
1362 const ImS32 s32_zero = 0, s32_one = 1, s32_fifty = 50, s32_min = INT_MIN/2, s32_max = INT_MAX/2, s32_hi_a = INT_MAX/2 - 100, s32_hi_b = INT_MAX/2;
1363 const ImU32 u32_zero = 0, u32_one = 1, u32_fifty = 50, u32_min = 0, u32_max = UINT_MAX/2, u32_hi_a = UINT_MAX/2 - 100, u32_hi_b = UINT_MAX/2;
1364 const ImS64 s64_zero = 0, s64_one = 1, s64_fifty = 50, s64_min = LLONG_MIN/2, s64_max = LLONG_MAX/2, s64_hi_a = LLONG_MAX/2 - 100, s64_hi_b = LLONG_MAX/2;
1365 const ImU64 u64_zero = 0, u64_one = 1, u64_fifty = 50, u64_min = 0, u64_max = ULLONG_MAX/2, u64_hi_a = ULLONG_MAX/2 - 100, u64_hi_b = ULLONG_MAX/2;
1366 const float f32_zero = 0.f, f32_one = 1.f, f32_lo_a = -10000000000.0f, f32_hi_a = +10000000000.0f;
1367 const double f64_zero = 0., f64_one = 1., f64_lo_a = -1000000000000000.0, f64_hi_a = +1000000000000000.0;
1370 static char s8_v = 127;
1371 static ImU8 u8_v = 255;
1372 static short s16_v = 32767;
1373 static ImU16 u16_v = 65535;
1374 static ImS32 s32_v = -1;
1376 static ImS64 s64_v = -1;
1378 static float f32_v = 0.123f;
1379 static double f64_v = 90000.01234567890123456789;
1381 const float drag_speed = 0.2f;
1382 static bool drag_clamp =
false;
1384 ImGui::Checkbox(
"Clamp integers to 0..50", &drag_clamp);
ImGui::SameLine();
HelpMarker(
"As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value.");
1422 static bool inputs_step =
true;
1443 static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
1444 static int vec4i[4] = { 1, 5, 100, 255 };
1474 const float spacing = 4;
1477 static int int_value = 0;
1481 static float values[7] = { 0.0f, 0.60f, 0.35f, 0.9f, 0.70f, 0.20f, 0.0f };
1483 for (
int i = 0;
i < 7;
i++)
1501 static float values2[4] = { 0.20f, 0.80f, 0.40f, 0.25f };
1503 const ImVec2 small_slider_size(18, (
float)(
int)((160.0
f - (rows - 1) * spacing) / rows));
1504 for (
int nx = 0; nx < 4; nx++)
1508 for (
int ny = 0; ny < rows; ny++)
1522 for (
int i = 0;
i < 4;
i++)
1543 HelpMarker(
"You can drag from the colored squares.");
1544 static float col1[3] = { 1.0f, 0.0f, 0.2f };
1545 static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
1559 static int mode = 0;
1563 static const char* names[9] = {
"Bobby",
"Beatrice",
"Betty",
"Brianna",
"Barry",
"Bernard",
"Bibi",
"Blaine",
"Bryn" };
1584 IM_ASSERT(payload->DataSize ==
sizeof(
int));
1585 int payload_n = *(
const int*)payload->Data;
1588 names[
n] = names[payload_n];
1590 if (
mode == Mode_Move)
1592 names[
n] = names[payload_n];
1593 names[payload_n] =
"";
1595 if (
mode == Mode_Swap)
1597 const char* tmp = names[
n];
1598 names[
n] = names[payload_n];
1599 names[payload_n] = tmp;
1612 HelpMarker(
"We don't use the drag and drop api at all here! Instead we query when the item is held but not hovered, and order items accordingly.");
1613 static const char* item_names[] = {
"Item One",
"Item Two",
"Item Three",
"Item Four",
"Item Five" };
1616 const char*
item = item_names[
n];
1624 item_names[
n] = item_names[n_next];
1625 item_names[n_next] =
item;
1639 static int item_type = 1;
1640 ImGui::Combo(
"Item Type", &item_type,
"Text\0Button\0Button (w/ repeat)\0Checkbox\0SliderFloat\0InputText\0InputFloat\0InputFloat3\0ColorEdit4\0MenuItem\0TreeNode\0TreeNode (w/ double-click)\0ListBox\0", 20);
1642 HelpMarker(
"Testing how various types of items are interacting with the IsItemXXX functions.");
1644 static bool b =
false;
1645 static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
1646 static char str[16] = {};
1647 if (item_type == 0) {
ImGui::Text(
"ITEM: Text"); }
1648 if (item_type == 1) { ret =
ImGui::Button(
"ITEM: Button"); }
1659 if (item_type == 12){
const char* items[] = {
"Apple",
"Banana",
"Cherry",
"Kiwi" };
static int current = 1; ret =
ImGui::ListBox(
"ITEM: ListBox", ¤t, items,
IM_ARRAYSIZE(items),
IM_ARRAYSIZE(items)); }
1666 "Return value = %d\n"
1667 "IsItemFocused() = %d\n"
1668 "IsItemHovered() = %d\n"
1669 "IsItemHovered(_AllowWhenBlockedByPopup) = %d\n"
1670 "IsItemHovered(_AllowWhenBlockedByActiveItem) = %d\n"
1671 "IsItemHovered(_AllowWhenOverlapped) = %d\n"
1672 "IsItemHovered(_RectOnly) = %d\n"
1673 "IsItemActive() = %d\n"
1674 "IsItemEdited() = %d\n"
1675 "IsItemActivated() = %d\n"
1676 "IsItemDeactivated() = %d\n"
1677 "IsItemDeactivatedAfterEdit() = %d\n"
1678 "IsItemVisible() = %d\n"
1679 "IsItemClicked() = %d\n"
1680 "IsItemToggledOpen() = %d\n"
1681 "GetItemRectMin() = (%.1f, %.1f)\n"
1682 "GetItemRectMax() = (%.1f, %.1f)\n"
1683 "GetItemRectSize() = (%.1f, %.1f)",
1704 static bool embed_all_inside_a_child_window =
false;
1705 ImGui::Checkbox(
"Embed everything inside a child window (for additional testing)", &embed_all_inside_a_child_window);
1706 if (embed_all_inside_a_child_window)
1712 "IsWindowFocused() = %d\n"
1713 "IsWindowFocused(_ChildWindows) = %d\n"
1714 "IsWindowFocused(_ChildWindows|_RootWindow) = %d\n"
1715 "IsWindowFocused(_RootWindow) = %d\n"
1716 "IsWindowFocused(_AnyWindow) = %d\n",
1726 "IsWindowHovered() = %d\n"
1727 "IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
1728 "IsWindowHovered(_AllowWhenBlockedByActiveItem) = %d\n"
1729 "IsWindowHovered(_ChildWindows) = %d\n"
1730 "IsWindowHovered(_ChildWindows|_RootWindow) = %d\n"
1731 "IsWindowHovered(_ChildWindows|_AllowWhenBlockedByPopup) = %d\n"
1732 "IsWindowHovered(_RootWindow) = %d\n"
1733 "IsWindowHovered(_AnyWindow) = %d\n",
1744 ImGui::Text(
"This is another child window for testing the _ChildWindows flag.");
1746 if (embed_all_inside_a_child_window)
1749 static char dummy_str[] =
"This is a dummy field to be able to tab-out of the widgets above.";
1754 static bool test_window =
false;
1755 ImGui::Checkbox(
"Hovered/Active tests after Begin() for title bar testing", &test_window);
1758 ImGui::Begin(
"Title bar Hovered/Active tests", &test_window);
1765 "IsItemHovered() after begin = %d (== is title bar hovered)\n"
1766 "IsItemActive() after begin = %d (== is window being clicked/moved)\n",
1782 HelpMarker(
"Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window.");
1783 static bool disable_mouse_wheel =
false;
1784 static bool disable_menu =
false;
1788 static int line = 50;
1798 for (
int i = 0;
i < 100;
i++)
1801 if (goto_line && line ==
i)
1804 if (goto_line && line >= 100)
1826 for (
int i = 0;
i < 100;
i++)
1829 sprintf(
buf,
"%03d",
i);
1849 for (
int n = 0;
n < 50;
n++)
1855 ImGui::Text(
"Rect of child window is: (%.0f,%.0f) (%.0f,%.0f)", child_rect_min.
x, child_rect_min.
y, child_rect_max.
x, child_rect_max.
y);
1865 static float f = 0.0f;
1866 ImGui::Text(
"SetNextItemWidth/PushItemWidth(100)");
1871 ImGui::Text(
"SetNextItemWidth/PushItemWidth(GetWindowWidth() * 0.5f)");
1876 ImGui::Text(
"SetNextItemWidth/PushItemWidth(GetContentRegionAvail().x * 0.5f)");
1881 ImGui::Text(
"SetNextItemWidth/PushItemWidth(-100)");
1887 ImGui::Text(
"SetNextItemWidth/PushItemWidth(-1)");
1900 ImGui::TextWrapped(
"(Use ImGui::SameLine() to keep adding items to the right of the preceding item)");
1931 static bool c1 =
false, c2 =
false, c3 =
false, c4 =
false;
1938 static float f0 = 1.0f, f1 = 2.0f, f2 = 3.0f;
1940 const char* items[] = {
"AAAA",
"BBBB",
"CCCC",
"DDDD" };
1941 static int item = -1;
1950 static int selection[4] = { 0, 1, 2, 3 };
1951 for (
int i = 0;
i < 4;
i++)
1962 ImVec2 button_sz(40, 40);
1970 int buttons_count = 20;
1972 for (
int n = 0;
n < buttons_count;
n++)
1977 float next_button_x2 = last_button_x2 + style.
ItemSpacing.
x + button_sz.
x;
1978 if (
n + 1 < buttons_count && next_button_x2 < window_visible_x2)
1995 ImGui::Text(
"This is the Avocado tab!\nblah blah blah blah blah");
2000 ImGui::Text(
"This is the Broccoli tab!\nblah blah blah blah blah");
2005 ImGui::Text(
"This is the Cucumber tab!\nblah blah blah blah blah");
2030 const char* names[4] = {
"Artichoke",
"Beetroot",
"Celery",
"Daikon" };
2031 static bool opened[4] = {
true,
true,
true,
true };
2059 HelpMarker(
"BeginGroup() basically locks the horizontal position for new line. EndGroup() bundles the whole group so that you can use \"item\" functions such as IsItemHovered()/IsItemActive() or SameLine() etc. on the whole group.");
2079 const float values[5] = { 0.5f, 0.20f, 0.80f, 0.60f, 0.25f };
2106 HelpMarker(
"This is testing the vertical alignment that gets applied on text to keep it aligned with widgets. Lines only composed of text or \"small\" widgets fit in less vertical spaces than lines with normal widgets.");
2111 HelpMarker(
"Baseline of button will look misaligned with text..");
2118 HelpMarker(
"We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y");
2203 HelpMarker(
"Use SetScrollHereY() or SetScrollFromPosY() to scroll to a given vertical position.");
2205 static int track_item = 50;
2206 static bool enable_track =
true;
2207 static bool enable_extra_decorations =
false;
2208 static float scroll_to_off_px = 0.0f;
2209 static float scroll_to_pos_px = 200.0f;
2213 HelpMarker(
"We expose this for testing because scrolling sometimes had issues with window decoration such as menu-bars.");
2226 if (scroll_to_off || scroll_to_pos)
2227 enable_track =
false;
2234 for (
int i = 0;
i < 5;
i++)
2238 const char* names[] = {
"Top",
"25%",
"Center",
"75%",
"Bottom" };
2256 if (enable_track &&
item == track_item)
2277 HelpMarker(
"Use SetScrollHereX() or SetScrollFromPosX() to scroll to a given horizontal position.\n\nUsing the \"Scroll To Pos\" button above will make the discontinuity at edges visible: scrolling to the top/bottom/left/right-most item will add an additional WindowPadding to reflect on reaching the edge of the list.\n\nBecause the clipping rectangle of most window hides half worth of WindowPadding on the left/right, using SetScrollFromPosX(+1) will usually result in clipped text whereas the equivalent SetScrollFromPosY(+1) wouldn't.");
2279 for (
int i = 0;
i < 5;
i++)
2292 if (enable_track &&
item == track_item)
2308 const char* names[] = {
"Left",
"25%",
"Center",
"75%",
"Right" };
2309 ImGui::Text(
"%s\n%.0f/%.0f", names[
i], scroll_x, scroll_max_x);
2315 HelpMarker(
"Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag.\n\nYou may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin().");
2316 static int lines = 7;
2321 for (
int line = 0; line < lines; line++)
2325 int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
2326 for (
int n = 0;
n < num_buttons;
n++)
2331 sprintf(num_buf,
"%d",
n);
2332 const char*
label = (!(
n%15)) ?
"FizzBuzz" : (!(
n%3)) ?
"Fizz" : (!(
n%5)) ?
"Buzz" : num_buf;
2333 float hue =
n*0.05f;
2346 float scroll_x_delta = 0.0f;
2351 if (scroll_x_delta != 0.0
f)
2359 static bool show_horizontal_contents_size_demo_window =
false;
2360 ImGui::Checkbox(
"Show Horizontal contents size demo window", &show_horizontal_contents_size_demo_window);
2362 if (show_horizontal_contents_size_demo_window)
2364 static bool show_h_scrollbar =
true;
2365 static bool show_button =
true;
2366 static bool show_tree_nodes =
true;
2367 static bool show_text_wrapped =
false;
2368 static bool show_columns =
true;
2369 static bool show_tab_bar =
true;
2370 static bool show_child =
false;
2371 static bool explicit_content_size =
false;
2372 static float contents_size_x = 300.0f;
2373 if (explicit_content_size)
2378 HelpMarker(
"Test of different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\nUse 'Metrics->Tools->Show windows rectangles' to visualize rectangles.");
2388 if (explicit_content_size)
2404 if (show_tree_nodes)
2418 if (show_text_wrapped)
2420 ImGui::TextWrapped(
"This text should automatically wrap on the edge of the work rectangle.");
2425 for (
int n = 0;
n < 4;
n++)
2454 ImGui::TextWrapped(
"On a per-widget basis we are occasionally clipping text CPU-side if it won't fit in its frame. Otherwise we are doing coarser clipping + passing a scissor rectangle to the renderer. The system is designed to try minimizing both execution and CPU/GPU rendering cost.");
2462 ImGui::GetWindowDrawList()->
AddText(
ImGui::GetFont(),
ImGui::GetFontSize()*2.0
f,
ImVec2(pos.
x +
offset.x, pos.
y +
offset.y),
IM_COL32(255, 255, 255, 255),
"Line 1 hello\nLine 2 clip me!",
NULL, 0.0
f, &clip_rect);
2490 ImGui::TextWrapped(
"When a popup is active, it inhibits interacting with windows that are behind the popup. Clicking outside the popup closes it.");
2492 static int selected_fish = -1;
2493 const char* names[] = {
"Bream",
"Haddock",
"Mackerel",
"Pollock",
"Tilefish" };
2494 static bool toggles[] = {
true,
false,
false,
false,
false };
2572 static float value = 0.5f;
2585 ImGui::Text(
"(You can also right-click me to open the same popup as above.)");
2591 static char name[32] =
"Label1";
2592 char buf[64]; sprintf(
buf,
"Button: %s###Button",
name);
2609 ImGui::TextWrapped(
"Modal windows are like popups but the user cannot close them by clicking outside the window.");
2616 ImGui::Text(
"All those beautiful files will be deleted.\nThis operation cannot be undone!\n\n");
2622 static bool dont_ask_me_next_time =
false;
2647 ImGui::Text(
"Hello from Stacked The First\nUsing style.Colors[ImGuiCol_ModalWindowDimBg] behind it.");
2650 static int item = 1;
2651 static float color[4] = { 0.4f,0.7f,0.0f,0.5f };
2660 bool dummy_open =
true;
2679 ImGui::TextWrapped(
"Below we are testing adding menu items to a regular window. It's rather unusual but should work!");
2704 static bool disable_indent =
false;
2707 HelpMarker(
"Disable the indenting of tree nodes so demo columns can use the full window width.");
2717 for (
int n = 0;
n < 14;
n++)
2720 sprintf(
label,
"Item %d",
n);
2736 const char* names[3] = {
"One",
"Two",
"Three" };
2737 const char* paths[3] = {
"/path/one",
"/path/two",
"/path/three" };
2738 static int selected = -1;
2739 for (
int i = 0;
i < 3;
i++)
2742 sprintf(
label,
"%04d",
i);
2759 static bool h_borders =
true;
2760 static bool v_borders =
true;
2761 static int columns_count = 4;
2762 const int lines_count = 3;
2764 ImGui::DragInt(
"##columns_count", &columns_count, 0.1
f, 2, 10,
"%d columns");
2765 if (columns_count < 2)
2772 for (
int i = 0;
i < columns_count * lines_count;
i++)
2802 static float foo = 1.0f;
2809 static float bar = 1.0f;
2867 int ITEMS_COUNT = 2000;
2869 while (clipper.
Step())
2872 for (
int j = 0; j < 10; j++)
2886 for (
int x = 0;
x < 3;
x++)
2894 for (
int y = 0;
y < 3;
y++)
2904 ImGui::Text(
"The quick brown fox jumps over the lazy dog");
2932 " \"\" display all lines\n"
2933 " \"xxx\" display lines containing \"xxx\"\n"
2934 " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
2935 " \"-xxx\" hide lines containing \"xxx\"");
2937 const char* lines[] = {
"aaa1.c",
"bbb1.c",
"ccc1.c",
"aaa2.cpp",
"bbb2.cpp",
"ccc2.cpp",
"abc.h",
"hello, world" };
2939 if (
filter.PassFilter(lines[
i]))
2978 ImGui::Button(
"Hovering me sets the\nkeyboard capture flag");
2982 ImGui::Button(
"Holding me clears the\nthe keyboard capture flag");
2991 ImGui::Text(
"Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
2992 static char buf[32] =
"dummy";
3010 static char buf[128] =
"click on a button to set focus";
3032 static float f3[3] = { 0.0f, 0.0f, 0.0f };
3033 int focus_ahead = -1;
3040 ImGui::TextWrapped(
"NB: Cursor & selection are preserved when refocusing last used item in code.");
3046 ImGui::TextWrapped(
"You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
3047 for (
int button = 0; button < 3; button++)
3048 ImGui::Text(
"IsMouseDragging(%d):\n w/ default threshold: %d,\n w/ zero threshold: %d\n w/ large threshold: %d",
3060 ImGui::Text(
"GetMouseDragDelta(0):\n w/ default threshold: (%.1f, %.1f),\n w/ zero threshold: (%.1f, %.1f)\nMouseDelta: (%.1f, %.1f)", value_with_lock_threshold.
x, value_with_lock_threshold.
y, value_raw.
x, value_raw.
y, mouse_delta.
x, mouse_delta.
y);
3066 const char* mouse_cursors_names[] = {
"Arrow",
"TextInput",
"ResizeAll",
"ResizeNS",
"ResizeEW",
"ResizeNESW",
"ResizeNWSE",
"Hand",
"NotAllowed" };
3071 ImGui::SameLine();
HelpMarker(
"Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, otherwise your backend needs to handle it.");
3075 sprintf(
label,
"Mouse cursor %d: %s",
i, mouse_cursors_names[
i]);
3099 ImGui::Text(
"By Omar Cornut and all Dear ImGui contributors.");
3100 ImGui::Text(
"Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
3102 static bool show_config_info =
false;
3104 if (show_config_info)
3109 bool copy_to_clipboard =
ImGui::Button(
"Copy to clipboard");
3111 if (copy_to_clipboard)
3119 ImGui::Text(
"sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (
int)
sizeof(
size_t), (
int)
sizeof(
ImDrawIdx), (
int)
sizeof(
ImDrawVert));
3120 ImGui::Text(
"define: __cplusplus=%d", (
int)__cplusplus);
3121 #ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3122 ImGui::Text(
"define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
3124 #ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
3125 ImGui::Text(
"define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS");
3127 #ifdef IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS
3128 ImGui::Text(
"define: IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS");
3130 #ifdef IMGUI_DISABLE_WIN32_FUNCTIONS
3131 ImGui::Text(
"define: IMGUI_DISABLE_WIN32_FUNCTIONS");
3133 #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
3134 ImGui::Text(
"define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS");
3136 #ifdef IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS
3137 ImGui::Text(
"define: IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS");
3139 #ifdef IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS
3140 ImGui::Text(
"define: IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS");
3142 #ifdef IMGUI_DISABLE_FILE_FUNCTIONS
3143 ImGui::Text(
"define: IMGUI_DISABLE_FILE_FUNCTIONS");
3145 #ifdef IMGUI_DISABLE_DEFAULT_ALLOCATORS
3146 ImGui::Text(
"define: IMGUI_DISABLE_DEFAULT_ALLOCATORS");
3148 #ifdef IMGUI_USE_BGRA_PACKED_COLOR
3149 ImGui::Text(
"define: IMGUI_USE_BGRA_PACKED_COLOR");
3173 ImGui::Text(
"define: __GNUC__=%d", (
int)__GNUC__);
3175 #ifdef __clang_version__
3176 ImGui::Text(
"define: __clang_version__=%s", __clang_version__);
3212 if (copy_to_clipboard)
3234 static int style_idx = -1;
3268 "- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n"
3269 "- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
3270 "- Read FAQ and docs/FONTS.txt for more details.\n"
3271 "- If you need to add/remove fonts at runtime (e.g. for DPI change), do it before calling NewFrame().");
3281 static bool init =
true;
3283 ref_saved_style = style;
3286 ref = &ref_saved_style;
3291 ref_saved_style = style;
3305 *
ref = ref_saved_style = style;
3310 HelpMarker(
"Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export\" below to save them somewhere.");
3344 if (
ImGui::Combo(
"WindowMenuButtonPosition", (
int*)&window_menu_button_position,
"None\0Left\0Right\0"))
3356 static int output_dest = 0;
3357 static bool output_only_modified =
true;
3360 if (output_dest == 0)
3369 if (!output_only_modified || memcmp(&col, &
ref->Colors[
i],
sizeof(
ImVec4)) != 0)
3370 ImGui::LogText(
"colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE,
name, 23 - (
int)strlen(
name),
"", col.
x, col.
y, col.
z, col.
w);
3384 HelpMarker(
"In the color list:\nLeft-click on colored square to open color picker,\nRight-click to open edit options menu.");
3416 HelpMarker(
"Read FAQ and docs/FONTS.txt for details on font loading.");
3424 if (font_details_opened)
3427 ImGui::Text(
"The quick brown fox jumps over the lazy dog");
3430 ImGui::SameLine();
HelpMarker(
"Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");
3440 ImGui::BulletText(
"Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
3456 for (
unsigned int n = 0;
n < 256;
n++)
3460 float cell_size = font->
FontSize * 1;
3464 for (
unsigned int n = 0;
n < 256;
n++)
3466 ImVec2 cell_p1(base_pos.
x + (
n % 16) * (cell_size + cell_spacing), base_pos.
y + (
n / 16) * (cell_size + cell_spacing));
3467 ImVec2 cell_p2(cell_p1.
x + cell_size, cell_p1.
y + cell_size);
3484 ImGui::Dummy(
ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
3502 HelpMarker(
"Those are old settings provided for convenience.\nHowever, the _correct_ way of scaling your UI is currently to reload your font at the designed size, rebuild the font atlas, and call style.ScaleAllSizes() on a reference ImGuiStyle structure.");
3503 static float window_scale = 1.0f;
3599 for (
int i = 0;
i < 10;
i++)
3602 static float f = 0.5f;
3630 static bool b =
true;
3671 AddLog(
"Welcome to Dear ImGui!");
3681 static int Stricmp(
const char* str1,
const char* str2) {
int d;
while ((
d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; }
return d; }
3682 static int Strnicmp(
const char* str1,
const char* str2,
int n) {
int d = 0;
while (
n > 0 && (
d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++;
n--; }
return d; }
3684 static void Strtrim(
char*
str) {
char* str_end =
str + strlen(
str);
while (str_end >
str && str_end[-1] ==
' ') str_end--; *str_end = 0; }
3705 void Draw(
const char* title,
bool* p_open)
3723 ImGui::TextWrapped(
"This example implements a console with basic coloring, completion and history. A more elaborate implementation may want to store entries along with extra data such as timestamp, emitter, etc.");
3747 Filter.
Draw(
"Filter (\"incl,-excl\") (\"error\")", 180);
3770 if (copy_to_clipboard)
3779 bool pop_color =
false;
3786 if (copy_to_clipboard)
3798 bool reclaim_focus =
false;
3806 reclaim_focus =
true;
3819 AddLog(
"# %s\n", command_line);
3833 if (
Stricmp(command_line,
"CLEAR") == 0)
3837 else if (
Stricmp(command_line,
"HELP") == 0)
3843 else if (
Stricmp(command_line,
"HISTORY") == 0)
3851 AddLog(
"Unknown command: '%s'\n", command_line);
3867 switch (
data->EventFlag)
3874 const char* word_end =
data->Buf +
data->CursorPos;
3875 const char* word_start = word_end;
3876 while (word_start >
data->Buf)
3878 const char c = word_start[-1];
3879 if (c ==
' ' || c ==
'\t' || c ==
',' || c ==
';')
3890 if (candidates.
Size == 0)
3893 AddLog(
"No match for \"%.*s\"!\n", (
int)(word_end-word_start), word_start);
3895 else if (candidates.
Size == 1)
3898 data->DeleteChars((
int)(word_start-
data->Buf), (
int)(word_end-word_start));
3899 data->InsertChars(
data->CursorPos, candidates[0]);
3900 data->InsertChars(
data->CursorPos,
" ");
3905 int match_len = (int)(word_end - word_start);
3909 bool all_candidates_matches =
true;
3910 for (
int i = 0;
i < candidates.
Size && all_candidates_matches;
i++)
3912 c = toupper(candidates[
i][match_len]);
3913 else if (c == 0 || c != toupper(candidates[
i][match_len]))
3914 all_candidates_matches =
false;
3915 if (!all_candidates_matches)
3922 data->DeleteChars((
int)(word_start -
data->Buf), (
int)(word_end-word_start));
3923 data->InsertChars(
data->CursorPos, candidates[0], candidates[0] + match_len);
3927 AddLog(
"Possible matches:\n");
3928 for (
int i = 0;
i < candidates.
Size;
i++)
3929 AddLog(
"- %s\n", candidates[
i]);
3956 data->DeleteChars(0,
data->BufTextLen);
3957 data->InsertChars(0, history_str);
3968 console.
Draw(
"Example: Console", p_open);
4006 for (
int new_size =
Buf.
size(); old_size < new_size; old_size++)
4007 if (
Buf[old_size] ==
'\n')
4046 const char* buf_end =
Buf.
end();
4074 while (clipper.
Step())
4107 static int counter = 0;
4108 for (
int n = 0;
n < 5;
n++)
4110 const char* categories[3] = {
"info",
"warn",
"error" };
4111 const char*
words[] = {
"Bumfuzzled",
"Cattywampus",
"Snickersnee",
"Abibliophobia",
"Absquatulate",
"Nincompoop",
"Pauciloquent" };
4112 log.
AddLog(
"[%05d] [%s] Hello, current time is %.1f, here's a word: '%s'\n",
4120 log.
Draw(
"Example: Log", p_open);
4144 static int selected = 0;
4146 for (
int i = 0;
i < 100;
i++)
4149 sprintf(
label,
"MyObject %d",
i);
4165 ImGui::TextWrapped(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
4198 HelpMarker(
"This example shows how you may implement a property editor using two columns.\nAll objects/fields data are dummies here.\nRemember that in many simple cases, you can use ImGui::SameLine(xxx) to position\nyour cursor horizontally instead of using the Columns() API.");
4206 static void ShowDummyObject(
const char*
prefix,
int uid)
4217 static float dummy_members[8] = { 0.0f,0.0f,1.0f,3.1416f,100.0f,999.0f };
4218 for (
int i = 0;
i < 8;
i++)
4223 ShowDummyObject(
"Child", 424242);
4247 for (
int obj_i = 0; obj_i < 3; obj_i++)
4248 funcs::ShowDummyObject(
"Object", obj_i);
4264 if (!
ImGui::Begin(
"Example: Long text display", p_open))
4270 static int test_type = 0;
4272 static int lines = 0;
4273 ImGui::Text(
"Printing unusually long amount of text.");
4274 ImGui::Combo(
"Test type", &test_type,
"Single call to TextUnformatted()\0Multiple calls to Text(), clipped\0Multiple calls to Text(), not clipped (slow)\0");
4275 ImGui::Text(
"Buffer contents: %d lines, %d bytes", lines, log.
size());
4280 for (
int i = 0;
i < 1000;
i++)
4281 log.
appendf(
"%i The quick brown fox jumps over the lazy dog\n", lines+
i);
4296 while (clipper.
Step())
4298 ImGui::Text(
"%i The quick brown fox jumps over the lazy dog",
i);
4305 for (
int i = 0;
i < lines;
i++)
4306 ImGui::Text(
"%i The quick brown fox jumps over the lazy dog",
i);
4327 static int lines = 10;
4328 ImGui::Text(
"Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop.");
4330 for (
int i = 0;
i < lines;
i++)
4342 struct CustomConstraints
4348 static bool auto_resize =
false;
4349 static int type = 0;
4350 static int display_lines = 10;
4362 const char*
desc[] =
4364 "Resize vertical only",
4365 "Resize horizontal only",
4366 "Width > 100, Height > 100",
4369 "Custom: Always Square",
4370 "Custom: Fixed Steps (100)",
4380 for (
int i = 0;
i < display_lines;
i++)
4381 ImGui::Text(
"%*sHello, sailor! Making this line long enough for the example.",
i * 4,
"");
4393 const float DISTANCE = 10.0f;
4394 static int corner = 0;
4399 ImVec2 window_pos_pivot =
ImVec2((corner & 1) ? 1.0
f : 0.0
f, (corner & 2) ? 1.0
f : 0.0
f);
4405 ImGui::Text(
"Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)");
4439 ImGui::Text(
"This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
4444 ImGui::Text(
"This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
4463 if (!
ImGui::Begin(
"Example: Custom rendering", p_open))
4502 static float sz = 36.0f;
4503 static float thickness = 3.0f;
4504 static int ngon_sides = 6;
4505 static bool circle_segments_override =
false;
4506 static int circle_segments_override_v = 12;
4511 ImGui::Checkbox(
"##circlesegmentoverride", &circle_segments_override);
4513 if (
ImGui::SliderInt(
"Circle segments", &circle_segments_override_v, 3, 40))
4514 circle_segments_override =
true;
4518 const float spacing = 10.0f;
4522 const int circle_segments = circle_segments_override ? circle_segments_override_v : 0;
4523 float x =
p.x + 4.0f,
y =
p.y + 4.0f;
4524 for (
int n = 0;
n < 2;
n++)
4527 float th = (
n == 0) ? 1.0
f : thickness;
4528 draw_list->
AddNgon(
ImVec2(
x + sz*0.5
f,
y + sz*0.5
f), sz*0.5f, col, ngon_sides, th);
x += sz + spacing;
4529 draw_list->
AddCircle(
ImVec2(
x + sz*0.5
f,
y + sz*0.5
f), sz*0.5f, col, circle_segments, th);
x += sz + spacing;
4552 draw_list->
AddRectFilledMultiColor(
ImVec2(
x,
y),
ImVec2(
x + sz,
y + sz),
IM_COL32(0, 0, 0, 255),
IM_COL32(255, 0, 0, 255),
IM_COL32(255, 255, 0, 255),
IM_COL32(0, 255, 0, 255));
4562 static bool adding_line =
false;
4565 ImGui::Text(
"Left-click and drag to add lines,\nRight-click to undo");
4572 if (canvas_size.
x < 50.0f) canvas_size.
x = 50.0f;
4573 if (canvas_size.
y < 50.0f) canvas_size.
y = 50.0f;
4574 draw_list->
AddRectFilledMultiColor(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y),
IM_COL32(50, 50, 50, 255),
IM_COL32(50, 50, 60, 255),
IM_COL32(60, 60, 70, 255),
IM_COL32(50, 50, 60, 255));
4575 draw_list->
AddRect(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y),
IM_COL32(255, 255, 255, 255));
4577 bool adding_preview =
false;
4582 adding_preview =
true;
4585 adding_line = adding_preview =
false;
4596 adding_line = adding_preview =
false;
4601 draw_list->
PushClipRect(canvas_pos,
ImVec2(canvas_pos.
x + canvas_size.
x, canvas_pos.
y + canvas_size.
y),
true);
4602 for (
int i = 0;
i < points.
Size - 1;
i += 2)
4603 draw_list->
AddLine(
ImVec2(canvas_pos.
x + points[
i].x, canvas_pos.
y + points[
i].y),
ImVec2(canvas_pos.
x + points[
i + 1].x, canvas_pos.
y + points[
i + 1].y),
IM_COL32(255, 255, 0, 255), 2.0
f);
4612 static bool draw_bg =
true;
4613 static bool draw_fg =
true;
4620 ImVec2 window_center =
ImVec2(window_pos.
x + window_size.
x * 0.5f, window_pos.
y + window_size.
y * 0.5f);
4667 ImGui::TextWrapped(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.");
4685 sprintf(
buf,
"Save %s", doc->
Name);
4732 static bool opt_reorderable =
true;
4736 if (!window_contents_visible)
4749 open_count += app.
Documents[doc_n].Open ? 1 : 0;
4791 if (opt_reorderable)
4829 if (close_queue.
empty())
4844 if (!close_queue.
empty())
4846 int close_queue_unsaved_documents = 0;
4847 for (
int n = 0;
n < close_queue.
Size;
n++)
4848 if (close_queue[
n]->Dirty)
4849 close_queue_unsaved_documents++;
4851 if (close_queue_unsaved_documents == 0)
4854 for (
int n = 0;
n < close_queue.
Size;
n++)
4855 close_queue[
n]->DoForceClose();
4856 close_queue.
clear();
4864 ImGui::Text(
"Save change to the following items?");
4868 for (
int n = 0;
n < close_queue.
Size;
n++)
4869 if (close_queue[
n]->Dirty)
4876 for (
int n = 0;
n < close_queue.
Size;
n++)
4878 if (close_queue[
n]->Dirty)
4879 close_queue[
n]->DoSave();
4880 close_queue[
n]->DoForceClose();
4882 close_queue.
clear();
4888 for (
int n = 0;
n < close_queue.
Size;
n++)
4889 close_queue[
n]->DoForceClose();
4890 close_queue.
clear();
4896 close_queue.
clear();
4917 #endif // #ifndef IMGUI_DISABLE
IMGUI_API ImVec2 GetCursorStartPos()
IMGUI_API void LogButtons()
static int Stricmp(const char *str1, const char *str2)
ImVector< MyDocument > Documents
float KeysDownDuration[512]
#define IMGUI_PAYLOAD_TYPE_COLOR_3F
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 *format="%d", const char *format_max=NULL)
IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value=true)
IMGUI_API bool BeginTabBar(const char *str_id, ImGuiTabBarFlags flags=0)
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 *format="%d")
IMGUI_API void PopButtonRepeat()
IMGUI_API void PushItemWidth(float item_width)
WEPOLL_INTERNAL int init(void)
@ ImGuiColorEditFlags_InputHSV
IMGUI_API bool InputInt3(const char *label, int v[3], ImGuiInputTextFlags flags=0)
IMGUI_API void EndDragDropSource()
IMGUI_API void EndMenuBar()
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2 &size_min, const ImVec2 &size_max, ImGuiSizeCallback custom_callback=NULL, void *custom_callback_data=NULL)
IMGUI_API void ListBoxFooter()
IMGUI_API bool BeginPopup(const char *str_id, ImGuiWindowFlags flags=0)
GLuint const GLchar * name
@ ImGuiInputTextFlags_CallbackResize
IMGUI_API void TextColored(const ImVec4 &col, const char *fmt,...) IM_FMTARGS(2)
IMGUI_API bool BeginPopupContextWindow(const char *str_id=NULL, ImGuiMouseButton mouse_button=1, bool also_over_items=true)
@ ImGuiColorEditFlags_HDR
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags=0)
IMGUI_API float GetTreeNodeToLabelSpacing()
MyDocument(const char *name, bool open=true, const ImVec4 &color=ImVec4(1.0f, 1.0f, 1.0f, 1.0f))
@ ImGuiWindowFlags_NoScrollbar
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 *format="%.3f", float power=1.0f)
IMGUI_API float GetScrollY()
int TextEditCallback(ImGuiInputTextCallbackData *data)
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags=0)
@ ImGuiColorEditFlags_NoInputs
IMGUI_API float GetColumnOffset(int column_index=-1)
@ ImGuiColorEditFlags_NoDragDrop
IMGUI_API void SetCursorPosX(float local_x)
IMGUI_API float GetColumnWidth(int column_index=-1)
IMGUI_API ImGuiID GetID(const char *str_id)
@ ImGuiHoveredFlags_ChildWindows
@ ImGuiInputTextFlags_CharsHexadecimal
IMGUI_API bool RadioButton(const char *label, bool active)
IMGUI_API void ProgressBar(float fraction, const ImVec2 &size_arg=ImVec2(-1, 0), const char *overlay=NULL)
IMGUI_API bool SliderInt2(const char *label, int v[2], int v_min, int v_max, const char *format="%d")
IMGUI_API void EndTabBar()
@ ImGuiInputTextFlags_CharsDecimal
IMGUI_API float GetTextLineHeightWithSpacing()
IMGUI_API void PushStyleColor(ImGuiCol idx, ImU32 col)
IMGUI_API void LabelText(const char *label, const char *fmt,...) IM_FMTARGS(2)
@ ImGuiComboFlags_NoPreview
void AddLog(const char *fmt,...) IM_FMTARGS(2)
@ ImGuiWindowFlags_NoBringToFrontOnFocus
@ ImGuiConfigFlags_NavEnableGamepad
IMGUI_API void SetNextWindowPos(const ImVec2 &pos, ImGuiCond cond=0, const ImVec2 &pivot=ImVec2(0, 0))
const char * GetDebugName() const
static void ShowExampleAppSimpleOverlay(bool *p_open)
IMGUI_API ImVec2 GetCursorScreenPos()
float MouseDownDuration[5]
IMGUI_API float GetFrameHeightWithSpacing()
#define IMGUI_PAYLOAD_TYPE_COLOR_4F
IMGUI_API bool BeginMenu(const char *label, bool enabled=true)
IMGUI_API bool IsItemEdited()
IMGUI_API void ShowAboutWindow(bool *p_open=NULL)
IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect=false)
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
@ ImGuiWindowFlags_NoBackground
bool ConfigWindowsMoveFromTitleBarOnly
IMGUI_API void LogToTTY(int auto_open_depth=-1)
IMGUI_API ImVec2 GetItemRectMin()
IMGUI_API bool IsItemActive()
IMGUI_API bool ColorPicker4(const char *label, float col[4], ImGuiColorEditFlags flags=0, const float *ref_col=NULL)
static void ShowDemoWindowPopups()
static int Strnicmp(const char *str1, const char *str2, int n)
ImVec2 DisplayFramebufferScale
IMGUI_API bool IsMouseDown(ImGuiMouseButton button)
IMGUI_API bool IsItemDeactivatedAfterEdit()
IMGUI_API void SetNextItemWidth(float item_width)
IMGUI_API bool IsItemToggledOpen()
IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags)
static int TextEditCallbackStub(ImGuiInputTextCallbackData *data)
const IMGUI_API char * GetVersion()
IMGUI_API bool Draw(const char *label="Filter (inc,-exc)", float width=0.0f)
@ ImGuiStyleVar_ChildRounding
IMGUI_API void PopStyleColor(int count=1)
GLuint GLsizei const GLchar * label
IMGUI_API void SetKeyboardFocusHere(int offset=0)
@ ImDrawCornerFlags_TopLeft
IMGUI_API void SetNextWindowBgAlpha(float alpha)
IMGUI_API void LogToClipboard(int auto_open_depth=-1)
@ ImGuiTabBarFlags_AutoSelectNewTabs
#define IMGUI_VERSION_NUM
IMGUI_API void PushAllowKeyboardFocus(bool allow_keyboard_focus)
IMGUI_API void SetScrollY(float scroll_y)
@ ImGuiInputTextFlags_CallbackHistory
IMGUI_API void AddRectFilled(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawCornerFlags rounding_corners=ImDrawCornerFlags_All)
IMGUI_API bool ListBoxHeader(const char *label, const ImVec2 &size=ImVec2(0, 0))
IMGUI_API void Dummy(const ImVec2 &size)
IMGUI_API void StyleColorsLight(ImGuiStyle *dst=NULL)
IMGUI_API void LogText(const char *fmt,...) IM_FMTARGS(1)
@ ImGuiColorEditFlags_NoSidePreview
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key)
IMGUI_API bool IsMouseHoveringRect(const ImVec2 &r_min, const ImVec2 &r_max, bool clip=true)
@ ImGuiColorEditFlags_AlphaPreview
float CurveTessellationTol
void ExecCommand(const char *command_line)
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 *format="%.3f", const char *format_max=NULL, float power=1.0f)
static char * Strdup(const char *str)
IMGUI_API void PushFont(ImFont *font)
float NavInputs[ImGuiNavInput_COUNT]
@ ImGuiTabBarFlags_FittingPolicyScroll
IMGUI_API void Unindent(float indent_w=0.0f)
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool InvisibleButton(const char *str_id, const ImVec2 &size)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END if(!upb_strtable_init(&intern->table, UPB_CTYPE_UINT64))
IMGUI_API void PopClipRect()
@ ImGuiColorEditFlags_NoPicker
@ ImGuiColorEditFlags_DisplayRGB
IMGUI_API ImVec2 GetWindowContentRegionMax()
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
IMGUI_API bool Selectable(const char *label, bool selected=false, ImGuiSelectableFlags flags=0, const ImVec2 &size=ImVec2(0, 0))
@ ImGuiWindowFlags_AlwaysVerticalScrollbar
bool FontAllowUserScaling
@ ImGuiWindowFlags_AlwaysAutoResize
@ ImGuiStyleVar_ItemSpacing
IMGUI_API bool SmallButton(const char *label)
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 *format="%d")
IMGUI_API ImVec2 GetWindowSize()
IMGUI_API void SetScrollHereY(float center_y_ratio=0.5f)
GLfloat GLfloat GLfloat alpha
ImVector< int > LineOffsets
IMGUI_API ImGuiIO & GetIO()
IMGUI_API bool VSliderFloat(const char *label, const ImVec2 &size, float *v, float v_min, float v_max, const char *format="%.3f", float power=1.0f)
@ ImGuiHoveredFlags_AnyWindow
static void DisplayContents(MyDocument *doc)
@ ImGuiWindowFlags_MenuBar
IMGUI_API void appendf(const char *fmt,...) IM_FMTARGS(2)
IMGUI_API bool IsItemVisible()
IMGUI_API void AddRectFilledMultiColor(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left)
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API void PushTextWrapPos(float wrap_local_pos_x=0.0f)
@ ImGuiFocusedFlags_AnyWindow
@ ImGuiWindowFlags_NoSavedSettings
IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags=0)
@ ImGuiComboFlags_PopupAlignLeft
IMGUI_API int GetColumnIndex()
IMGUI_API ImGuiMouseCursor GetMouseCursor()
IMGUI_API bool CheckboxFlags(const char *label, unsigned int *flags, unsigned int flags_value)
IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type)
IMGUI_API void LogFinish()
IMGUI_API float GetWindowWidth()
static uint32_t idx(tarjan *t, const upb_refcounted *r)
static void NotifyOfDocumentsClosedElsewhere(ExampleAppDocuments &app)
static void ShowExampleAppConsole(bool *p_open)
IMGUI_API bool SliderScalar(const char *label, ImGuiDataType data_type, void *p_data, const void *p_min, const void *p_max, const char *format=NULL, float power=1.0f)
static void ShowExampleAppWindowTitles(bool *p_open)
@ ImGuiTabBarFlags_FittingPolicyResizeDown
@ ImGuiColorEditFlags_NoTooltip
IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button=0, float lock_threshold=-1.0f)
IMGUI_API void EndCombo()
@ ImGuiHoveredFlags_AllowWhenBlockedByPopup
@ ImGuiTabBarFlags_TabListPopupButton
static void ShowDemoWindowLayout()
ImVec2 SelectableTextAlign
IMGUI_API void AddText(const ImVec2 &pos, ImU32 col, const char *text_begin, const char *text_end=NULL)
IMGUI_API bool InputInt2(const char *label, int v[2], ImGuiInputTextFlags flags=0)
IMGUI_API bool ColorEdit4(const char *label, float col[4], ImGuiColorEditFlags flags=0)
@ ImGuiInputTextFlags_CharsNoBlank
@ ImGuiTabBarFlags_NoCloseWithMiddleMouseButton
@ ImGuiInputTextFlags_Password
IMGUI_API bool SliderFloat2(const char *label, float v[2], float v_min, float v_max, const char *format="%.3f", float power=1.0f)
GLboolean GLboolean GLboolean b
ImGuiDir ColorButtonPosition
IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button=0)
static void ShowDemoWindowWidgets()
IMGUI_API bool IsPopupOpen(const char *str_id)
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags=0)
@ ImGuiInputTextFlags_CallbackCompletion
IMGUI_API void Separator()
GLenum GLsizei GLsizei GLint * values
IMGUI_API void ShowStyleEditor(ImGuiStyle *ref=NULL)
@ ImGuiSelectableFlags_SpanAllColumns
IMGUI_API void BeginGroup()
@ ImGuiBackendFlags_HasMouseCursors
GLenum GLenum GLsizei const GLuint GLboolean enabled
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
static size_t begin(const upb_table *t)
IMGUI_API float GetScrollX()
@ ImGuiTreeNodeFlags_SpanAvailWidth
@ ImGuiStyleVar_GrabMinSize
IMGUI_API bool PassFilter(const char *text, const char *text_end=NULL) const
IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat=true)
IMGUI_API bool InputDouble(const char *label, double *v, double step=0.0, double step_fast=0.0, const char *format="%.6f", ImGuiInputTextFlags flags=0)
IMGUI_API void AddCircleFilled(const ImVec2 ¢er, float radius, ImU32 col, int num_segments=12)
bool ConfigInputTextCursorBlink
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))
IMGUI_API bool Combo(const char *label, int *current_item, const char *const items[], int items_count, int popup_max_height_in_items=-1)
IMGUI_API void SetWindowFontScale(float scale)
IMGUI_API ImDrawList * GetBackgroundDrawList()
@ ImGuiColorEditFlags_Uint8
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float &out_r, float &out_g, float &out_b)
@ ImGuiColorEditFlags_NoBorder
IMGUI_API void SetItemDefaultFocus()
IMGUI_API bool BeginPopupContextItem(const char *str_id=NULL, ImGuiMouseButton mouse_button=1)
IMGUI_API void AddTriangleFilled(const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, ImU32 col)
bool ConfigMacOSXBehaviors
static const char prefix[]
IMGUI_API void SetScrollX(float scroll_x)
@ ImGuiTreeNodeFlags_None
IMGUI_API void ShowDemoWindow(bool *p_open=NULL)
ImGuiConfigFlags ConfigFlags
IMGUI_API bool TreeNodeEx(const char *label, ImGuiTreeNodeFlags flags=0)
@ ImGuiColorEditFlags_AlphaBar
const IMGUI_API ImFontGlyph * FindGlyphNoFallback(ImWchar c) const
@ ImGuiHoveredFlags_RootWindow
IMGUI_API bool BeginChild(const char *str_id, const ImVec2 &size=ImVec2(0, 0), bool border=false, ImGuiWindowFlags flags=0)
IMGUI_API void ShowUserGuide()
float CircleSegmentMaxError
@ ImGuiInputTextFlags_ReadOnly
IMGUI_API void Columns(int count=1, const char *id=NULL, bool border=true)
static void ShowDemoWindowColumns()
const char * begin() const
@ ImGuiBackendFlags_HasSetMousePos
IMGUI_API float GetScrollMaxX()
@ ImGuiStyleVar_SelectableTextAlign
IMGUI_API void AddNgon(const ImVec2 ¢er, float radius, ImU32 col, int num_segments, float thickness=1.0f)
void push_back(const T &v)
IMGUI_API void TextDisabled(const char *fmt,...) IM_FMTARGS(1)
GTEST_API_ const char * fmt
IMGUI_API void PushID(const char *str_id)
IMGUI_API float GetCursorPosX()
IMGUI_API float CalcItemWidth()
IMGUI_API bool InputFloat4(const char *label, float v[4], const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API void SetTooltip(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool SliderFloat(const char *label, float *v, float v_min, float v_max, const char *format="%.3f", float power=1.0f)
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 *format="%d")
@ ImGuiInputTextFlags_EnterReturnsTrue
ImVec2 DisplaySafeAreaPadding
ImVec2 MouseClickedPos[5]
IMGUI_API void AddTriangle(const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, ImU32 col, float thickness=1.0f)
IMGUI_API void EndGroup()
IMGUI_API bool OpenPopupOnItemClick(const char *str_id=NULL, ImGuiMouseButton mouse_button=1)
IMGUI_API bool SliderFloat3(const char *label, float v[3], float v_min, float v_max, const char *format="%.3f", float power=1.0f)
const ImFontConfig * ConfigData
IMGUI_API bool BeginTabItem(const char *label, bool *p_open=NULL, ImGuiTabItemFlags flags=0)
@ ImGuiColorEditFlags_DisplayHSV
#define IM_ARRAYSIZE(_ARR)
IMGUI_API bool TreeNode(const char *label)
IMGUI_API bool BeginDragDropTarget()
IMGUI_API bool ShowStyleSelector(const char *label)
@ ImGuiColorEditFlags_PickerHueBar
IMGUI_API bool InputInt4(const char *label, int v[4], ImGuiInputTextFlags flags=0)
static void DisplayContextMenu(MyDocument *doc)
IMGUI_API bool IsKeyReleased(int user_key_index)
IMGUI_API bool InputTextWithHint(const char *label, const char *hint, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
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 *format="%.3f", float power=1.0f)
IMGUI_API bool VSliderInt(const char *label, const ImVec2 &size, int *v, int v_min, int v_max, const char *format="%d")
@ ImGuiColorEditFlags_AlphaPreviewHalf
IMGUI_API bool MenuItem(const char *label, const char *shortcut=NULL, bool selected=false, bool enabled=true)
@ ImGuiHoveredFlags_AllowWhenOverlapped
IMGUI_API bool SliderInt3(const char *label, int v[3], int v_min, int v_max, const char *format="%d")
@ ImGuiWindowFlags_NoFocusOnAppearing
@ ImGuiWindowFlags_HorizontalScrollbar
@ ImGuiStyleVar_FramePadding
IMGUI_API bool Checkbox(const char *label, bool *v)
const IMGUI_API ImGuiPayload * AcceptDragDropPayload(const char *type, ImGuiDragDropFlags flags=0)
IMGUI_API bool InputFloat2(const char *label, float v[2], const char *format="%.3f", ImGuiInputTextFlags flags=0)
@ ImGuiSelectableFlags_None
IMGUI_API bool IsMousePosValid(const ImVec2 *mouse_pos=NULL)
IMGUI_API bool DragScalar(const char *label, ImGuiDataType data_type, void *p_data, float v_speed, const void *p_min=NULL, const void *p_max=NULL, const char *format=NULL, float power=1.0f)
IMGUI_API int GetFrameCount()
@ ImGuiTreeNodeFlags_Leaf
GLenum GLuint GLenum GLsizei const GLchar * buf
float ConfigWindowsMemoryCompactTimer
@ ImGuiSelectableFlags_AllowDoubleClick
IMGUI_API void SetNextWindowSize(const ImVec2 &size, ImGuiCond cond=0)
@ ImGuiBackendFlags_RendererHasVtxOffset
static void HelpMarker(const char *desc)
static void ShowExampleAppLayout(bool *p_open)
static void Strtrim(char *str)
IMGUI_API bool SliderInt4(const char *label, int v[4], int v_min, int v_max, const char *format="%d")
IMGUI_API ImVec2 GetContentRegionAvail()
static void ShowExampleAppDocuments(bool *p_open)
@ ImGuiTreeNodeFlags_NoTreePushOnOpen
IMGUI_API ImDrawList * GetForegroundDrawList()
IMGUI_API void AddLine(const ImVec2 &p1, const ImVec2 &p2, ImU32 col, float thickness=1.0f)
IMGUI_API float GetFontSize()
void Draw(const char *title, bool *p_open)
IMGUI_API void PopStyleVar(int count=1)
IMGUI_API void SetNextItemOpen(bool is_open, ImGuiCond cond=0)
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
IMGUI_API bool InputInt(const char *label, int *v, int step=1, int step_fast=100, ImGuiInputTextFlags flags=0)
float NavInputsDownDuration[ImGuiNavInput_COUNT]
IMGUI_API bool InputFloat3(const char *label, float v[3], const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API void EndMainMenuBar()
static void ShowDemoWindowMisc()
ImVector< const char * > Commands
IMGUI_API void TextWrapped(const char *fmt,...) IM_FMTARGS(1)
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat=false)
IMGUI_API bool ArrowButton(const char *str_id, ImGuiDir dir)
IMGUI_API bool ColorButton(const char *desc_id, const ImVec4 &col, ImGuiColorEditFlags flags=0, ImVec2 size=ImVec2(0, 0))
GLdouble GLdouble GLdouble z
IMGUI_API ImVec2 GetWindowPos()
const char * BackendPlatformName
ImVector< ImWchar > InputQueueCharacters
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button)
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
IMGUI_API void EndTooltip()
@ ImGuiWindowFlags_NoDecoration
IMGUI_API bool DragInt(const char *label, int *v, float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
IMGUI_API bool IsGlyphRangeUnused(unsigned int c_begin, unsigned int c_last)
@ ImGuiFocusedFlags_RootWindow
IMGUI_API void ShowFontSelector(const char *label)
@ ImGuiInputTextFlags_CallbackCharFilter
ImVector< ImFont * > Fonts
@ ImGuiHoveredFlags_AllowWhenBlockedByActiveItem
IMGUI_API void AlignTextToFramePadding()
@ ImGuiConfigFlags_NavEnableKeyboard
@ ImGuiTreeNodeFlags_OpenOnDoubleClick
IMGUI_API void Indent(float indent_w=0.0f)
IMGUI_API bool ColorEdit3(const char *label, float col[3], ImGuiColorEditFlags flags=0)
@ ImGuiTabBarFlags_FittingPolicyMask_
IMGUI_API void TextUnformatted(const char *text, const char *text_end=NULL)
static void ShowExampleAppPropertyEditor(bool *p_open)
IMGUI_API void PopAllowKeyboardFocus()
@ ImGuiColorEditFlags_NoAlpha
IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button=0)
IMGUI_API void PushButtonRepeat(bool repeat)
@ ImGuiTreeNodeFlags_SpanFullWidth
static void ShowExampleMenuFile()
IMGUI_API bool IsItemActivated()
IMGUI_API void StyleColorsClassic(ImGuiStyle *dst=NULL)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
IMGUI_API void BeginTooltip()
@ ImGuiColorEditFlags_NoLabel
@ ImGuiTabBarFlags_Reorderable
@ ImGuiTreeNodeFlags_Selected
IMGUI_API bool SetDragDropPayload(const char *type, const void *data, size_t sz, ImGuiCond cond=0)
IMGUI_API void PopItemWidth()
@ ImGuiConfigFlags_NavNoCaptureKeyboard
ImVector< char * > History
IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button)
@ ImGuiWindowFlags_NoMove
@ ImGuiInputTextFlags_AllowTabInput
@ ImGuiColorEditFlags_PickerHueWheel
IMGUI_API float GetTextLineHeight()
bool ConfigWindowsResizeFromEdges
IMGUI_API void EndTabItem()
@ ImDrawCornerFlags_BotRight
IMGUI_API bool InputScalar(const char *label, ImGuiDataType data_type, void *p_data, const void *p_step=NULL, const void *p_step_fast=NULL, const char *format=NULL, ImGuiInputTextFlags flags=0)
IMGUI_API void PopTextWrapPos()
ImVec4 Colors[ImGuiCol_COUNT]
void resize(int new_size)
IMGUI_API ImDrawList * GetWindowDrawList()
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
IMGUI_API double GetTime()
IMGUI_API bool SliderAngle(const char *label, float *v_rad, float v_degrees_min=-360.0f, float v_degrees_max=+360.0f, const char *format="%.0f deg")
IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold=-1.0f)
IMGUI_API void Begin(int items_count, float items_height=-1.0f)
@ ImGuiColorEditFlags_DisplayHex
IMGUI_API bool IsItemFocused()
IMGUI_API ImVec2 GetItemRectSize()
const char * BackendRendererName
IMGUI_API void PushStyleVar(ImGuiStyleVar idx, float val)
@ ImGuiColorEditFlags_NoOptions
IMGUI_API void SetWindowSize(const ImVec2 &size, ImGuiCond cond=0)
void AddLog(const char *fmt,...) IM_FMTARGS(2)
static void ShowExampleAppAutoResize(bool *p_open)
@ ImGuiTreeNodeFlags_Bullet
IMGUI_API void AddNgonFilled(const ImVec2 ¢er, float radius, ImU32 col, int num_segments)
IMGUI_API bool BeginMenuBar()
@ ImGuiTabItemFlags_UnsavedDocument
static void ShowExampleAppLongText(bool *p_open)
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 *format="%.3f", float power=1.0f)
ImGuiDir WindowMenuButtonPosition
@ ImGuiWindowFlags_NoCollapse
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 *format="%.3f", float power=1.0f)
@ ImGuiTabBarFlags_FittingPolicyDefault_
IMGUI_API void RenderChar(ImDrawList *draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const
IMGUI_API void SetNextWindowContentSize(const ImVec2 &size)
@ ImGuiConfigFlags_NoMouse
IMGUI_API ImVec2 GetCursorPos()
IMGUI_API void appendfv(const char *fmt, va_list args) IM_FMTLIST(2)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
IMGUI_API bool ListBox(const char *label, int *current_item, const char *const items[], int items_count, int height_in_items=-1)
@ ImGuiComboFlags_NoArrowButton
IMGUI_API ImVec2 GetItemRectMax()
static ImColor HSV(float h, float s, float v, float a=1.0f)
std::vector< std::string > words
IMGUI_API void NextColumn()
IMGUI_API void AddBezierCurve(const ImVec2 &p1, const ImVec2 &p2, const ImVec2 &p3, const ImVec2 &p4, ImU32 col, float thickness, int num_segments=0)
IMGUI_API void SetScrollHereX(float center_x_ratio=0.5f)
static void ShowExampleAppMainMenuBar()
IMGUI_API float GetFrameHeight()
IMGUI_API void CloseCurrentPopup()
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))
@ ImGuiConfigFlags_NavEnableSetMousePos
@ ImGuiWindowFlags_NoTitleBar
IMGUI_API bool SliderFloat4(const char *label, float v[4], float v_min, float v_max, const char *format="%.3f", float power=1.0f)
#define IM_UNICODE_CODEPOINT_MAX
IMGUI_API ImGuiStyle & GetStyle()
@ ImGuiInputTextFlags_CtrlEnterForNewLine
IMGUI_API bool BeginMainMenuBar()
@ ImGuiWindowFlags_NoScrollWithMouse
@ ImGuiWindowFlags_AlwaysHorizontalScrollbar
GLsizei const GLfloat * value
@ ImGuiInputTextFlags_CharsUppercase
IMGUI_API float GetWindowContentRegionWidth()
@ ImGuiWindowFlags_NoResize
IMGUI_API void SetTabItemClosed(const char *tab_or_docked_window_label)
IMGUI_API void ShowMetricsWindow(bool *p_open=NULL)
IMGUI_API void EndChild()
@ ImGuiColorEditFlags_Float
const IMGUI_API char * GetStyleColorName(ImGuiCol idx)
@ ImGuiColorEditFlags_NoSmallPreview
IMGUI_API void OpenPopup(const char *str_id)
IMGUI_API void SetScrollFromPosY(float local_y, float center_y_ratio=0.5f)
static void ShowExampleAppLog(bool *p_open)
@ ImGuiCol_FrameBgHovered
IMGUI_API void EndDragDropTarget()
IMGUI_API void AddCircle(const ImVec2 ¢er, float radius, ImU32 col, int num_segments=12, float thickness=1.0f)
IMGUI_API bool SliderInt(const char *label, int *v, int v_min, int v_max, const char *format="%d")
IMGUI_API void StyleColorsDark(ImGuiStyle *dst=NULL)
@ ImGuiStyleVar_FrameRounding
#define IM_COL32(R, G, B, A)
IMGUI_API bool BeginPopupModal(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
IMGUI_API float GetScrollMaxY()
static void check(upb_inttable *t)
@ ImGuiDragDropFlags_None
ImGuiBackendFlags BackendFlags
void Draw(const char *title, bool *p_open=NULL)
static void ShowExampleAppCustomRendering(bool *p_open)
IMGUI_API void EndChildFrame()
IMGUI_API void SetScrollFromPosX(float local_x, float center_x_ratio=0.5f)
IMGUI_API ImU32 GetColorU32(ImGuiCol idx, float alpha_mul=1.0f)
ImVector< ImFontGlyph > Glyphs
@ ImGuiConfigFlags_NoMouseCursorChange
IMGUI_API bool IsItemDeactivated()
@ ImGuiBackendFlags_HasGamepad
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))
IMGUI_API ImGuiContext * GetCurrentContext()
IMGUI_API void EndPopup()
@ ImGuiStyleVar_IndentSpacing
IMGUI_API void BulletText(const char *fmt,...) IM_FMTARGS(1)
static void ShowExampleAppConstrainedResize(bool *p_open)
IMGUI_API bool InputFloat(const char *label, float *v, float step=0.0f, float step_fast=0.0f, const char *format="%.3f", ImGuiInputTextFlags flags=0)
IMGUI_API void AddRect(const ImVec2 &p_min, const ImVec2 &p_max, ImU32 col, float rounding=0.0f, ImDrawCornerFlags rounding_corners=ImDrawCornerFlags_All, float thickness=1.0f)
@ ImGuiHoveredFlags_RectOnly
@ ImGuiTreeNodeFlags_OpenOnArrow
IMGUI_API ImFont * GetFont()
IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2 &size, ImGuiWindowFlags flags=0)
@ ImGuiWindowFlags_NavFlattened
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))
@ ImGuiFocusedFlags_ChildWindows
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:54