├── LICENSE └── ImGui__ChaiScript.h /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /ImGui__ChaiScript.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | using namespace ImGui; 6 | using namespace chaiscript; 7 | using namespace chaiscript::bootstrap; 8 | 9 | #pragma region 10 | 11 | bool Impl_Combo(const std::string& label, int& current_item, const std::vector& items, int height_in_items = -1) 12 | { 13 | std::vector vec_str; for (const auto& bv : items) vec_str.emplace_back(boxed_cast(bv)); 14 | auto getter = [](void* data, int idx, const char** out_text) -> bool { *out_text = static_cast*>(data)->at(idx).c_str(); return *out_text; }; 15 | return Combo(label.c_str(), (int*)¤t_item, getter, (void*)&vec_str, (int)items.size(), height_in_items); 16 | } 17 | 18 | bool Impl_ColorEdit3(const std::string& label, const std::vector& items) 19 | { 20 | if (items.size() == 3) 21 | { 22 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 23 | bool ret = ColorEdit3(label.c_str(), f); 24 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 25 | return ret; 26 | } 27 | return false; 28 | } 29 | 30 | bool Impl_ColorEdit4(const std::string& label, const std::vector& items, bool show_alpha = true) 31 | { 32 | if (items.size() == 4) 33 | { 34 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 35 | bool ret = ColorEdit4(label.c_str(), f, show_alpha); 36 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 37 | return ret; 38 | } 39 | return false; 40 | } 41 | 42 | bool Impl_DragFloat2(const std::string& label, const std::vector& items, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const std::string& display_format = "%.3f", float power = 1.0f) 43 | { 44 | if (items.size() == 2) 45 | { 46 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]) }; 47 | bool ret = DragFloat2(label.c_str(), f, v_speed, v_min, v_max, display_format.c_str(), power); 48 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 49 | return ret; 50 | } 51 | return false; 52 | } 53 | 54 | bool Impl_DragFloat3(const std::string& label, const std::vector& items, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const std::string& display_format = "%.3f", float power = 1.0f) 55 | { 56 | if (items.size() == 3) 57 | { 58 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 59 | bool ret = DragFloat3(label.c_str(), f, v_speed, v_min, v_max, display_format.c_str(), power); 60 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 61 | return ret; 62 | } 63 | return false; 64 | } 65 | 66 | bool Impl_DragFloat4(const std::string& label, const std::vector& items, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const std::string& display_format = "%.3f", float power = 1.0f) 67 | { 68 | if (items.size() == 4) 69 | { 70 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 71 | bool ret = DragFloat4(label.c_str(), f, v_speed, v_min, v_max, display_format.c_str(), power); 72 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 73 | return ret; 74 | } 75 | return false; 76 | } 77 | 78 | bool Impl_DragInt2(const std::string& label, const std::vector& items, int v_speed = 1.0f, int v_min = 0.0f, int v_max = 0.0f, const std::string& display_format = "%.0f") 79 | { 80 | if (items.size() == 2) 81 | { 82 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]) }; 83 | bool ret = DragInt2(label.c_str(), v, v_speed, v_min, v_max, display_format.c_str()); 84 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 85 | return ret; 86 | } 87 | return false; 88 | } 89 | 90 | bool Impl_DragInt3(const std::string& label, const std::vector& items, int v_speed = 1.0f, int v_min = 0.0f, int v_max = 0.0f, const std::string& display_format = "%.0f") 91 | { 92 | if (items.size() == 3) 93 | { 94 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 95 | bool ret = DragInt3(label.c_str(), v, v_speed, v_min, v_max, display_format.c_str()); 96 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 97 | return ret; 98 | } 99 | return false; 100 | } 101 | 102 | bool Impl_DragInt4(const std::string& label, const std::vector& items, int v_speed = 1.0f, int v_min = 0.0f, int v_max = 0.0f, const std::string& display_format = "%.0f") 103 | { 104 | if (items.size() == 4) 105 | { 106 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 107 | bool ret = DragInt4(label.c_str(), v, v_speed, v_min, v_max, display_format.c_str()); 108 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 109 | return ret; 110 | } 111 | return false; 112 | } 113 | 114 | bool Impl_InputText(const std::string& label, std::string& text, int max_size = 255, ImGuiInputTextFlags flags = 0) 115 | { 116 | char *buffer = new char[max_size](); 117 | text.copy(buffer, text.size() < max_size ? text.size() : max_size); 118 | bool ret = InputText(label.c_str(), buffer, max_size, flags); 119 | text = buffer; 120 | delete buffer; 121 | return ret; 122 | } 123 | 124 | bool Impl_InputTextMultine(const std::string& label, std::string& text, int max_size = 255, ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0) 125 | { 126 | char *buffer = new char[max_size](); 127 | text.copy(buffer, text.size() < max_size ? text.size() : max_size); 128 | bool ret = InputTextMultiline(label.c_str(), buffer, max_size, size, flags); 129 | text = buffer; 130 | delete buffer; 131 | return ret; 132 | } 133 | 134 | bool Impl_InputFloat2(const std::string& label, const std::vector& items, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0) 135 | { 136 | if (items.size() == 2) 137 | { 138 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]) }; 139 | bool ret = InputFloat2(label.c_str(), f, decimal_precision, extra_flags); 140 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 141 | return ret; 142 | } 143 | return false; 144 | } 145 | 146 | bool Impl_InputFloat3(const std::string& label, const std::vector& items, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0) 147 | { 148 | if (items.size() == 3) 149 | { 150 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 151 | bool ret = InputFloat3(label.c_str(), f, decimal_precision, extra_flags); 152 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 153 | return ret; 154 | } 155 | return false; 156 | } 157 | 158 | bool Impl_InputFloat4(const std::string& label, const std::vector& items, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0) 159 | { 160 | if (items.size() == 4) 161 | { 162 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 163 | bool ret = InputFloat4(label.c_str(), f, decimal_precision, extra_flags); 164 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 165 | return ret; 166 | } 167 | return false; 168 | } 169 | 170 | bool Impl_InputInt2(const std::string& label, const std::vector& items, ImGuiInputTextFlags extra_flags = 0) 171 | { 172 | if (items.size() == 2) 173 | { 174 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]) }; 175 | bool ret = InputInt2(label.c_str(), v, extra_flags); 176 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 177 | return ret; 178 | } 179 | return false; 180 | } 181 | 182 | bool Impl_InputInt3(const std::string& label, const std::vector& items, ImGuiInputTextFlags extra_flags = 0) 183 | { 184 | if (items.size() == 3) 185 | { 186 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 187 | bool ret = InputInt3(label.c_str(), v, extra_flags); 188 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 189 | return ret; 190 | } 191 | return false; 192 | } 193 | 194 | bool Impl_InputInt4(const std::string& label, const std::vector& items, ImGuiInputTextFlags extra_flags = 0) 195 | { 196 | if (items.size() == 4) 197 | { 198 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 199 | bool ret = InputInt4(label.c_str(), v, extra_flags); 200 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 201 | return ret; 202 | } 203 | return false; 204 | } 205 | 206 | bool Impl_SliderFloat2(const std::string& label, const std::vector& items, float v_min, float v_max, const std::string& display_format = "%.3f", float power = 1.0f) 207 | { 208 | if (items.size() == 2) 209 | { 210 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]) }; 211 | bool ret = SliderFloat2(label.c_str(), f, v_min, v_max, display_format.c_str(), power); 212 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 213 | return ret; 214 | } 215 | return false; 216 | } 217 | 218 | bool Impl_SliderFloat3(const std::string& label, const std::vector& items, float v_min, float v_max, const std::string& display_format = "%.3f", float power = 1.0f) 219 | { 220 | if (items.size() == 3) 221 | { 222 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 223 | bool ret = SliderFloat3(label.c_str(), f, v_min, v_max, display_format.c_str(), power); 224 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 225 | return ret; 226 | } 227 | return false; 228 | } 229 | 230 | bool Impl_SliderFloat4(const std::string& label, const std::vector& items, float v_min, float v_max, const std::string& display_format = "%.3f", float power = 1.0f) 231 | { 232 | if (items.size() == 4) 233 | { 234 | float f[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 235 | bool ret = SliderFloat4(label.c_str(), f, v_min, v_max, display_format.c_str(), power); 236 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = f[i]; 237 | return ret; 238 | } 239 | return false; 240 | } 241 | 242 | bool Impl_SliderInt2(const std::string& label, const std::vector& items, int v_min, int v_max, const std::string& display_format = "%.0f") 243 | { 244 | if (items.size() == 2) 245 | { 246 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]) }; 247 | bool ret = SliderInt2(label.c_str(), v, v_min, v_max, display_format.c_str()); 248 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 249 | return ret; 250 | } 251 | return false; 252 | } 253 | 254 | bool Impl_SliderInt3(const std::string& label, const std::vector& items, int v_min, int v_max, const std::string& display_format = "%.0f") 255 | { 256 | if (items.size() == 3) 257 | { 258 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]) }; 259 | bool ret = SliderInt3(label.c_str(), v, v_min, v_max, display_format.c_str()); 260 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 261 | return ret; 262 | } 263 | return false; 264 | } 265 | 266 | bool Impl_SliderInt4(const std::string& label, const std::vector& items, int v_min, int v_max, const std::string& display_format = "%.0f") 267 | { 268 | if (items.size() == 4) 269 | { 270 | int v[] = { *boxed_cast(items[0]), *boxed_cast(items[1]), *boxed_cast(items[2]), *boxed_cast(items[3]) }; 271 | bool ret = SliderInt4(label.c_str(), v, v_min, v_max, display_format.c_str()); 272 | for (int i = 0; i < items.size(); i++) *boxed_cast(items[i]) = v[i]; 273 | return ret; 274 | } 275 | return false; 276 | } 277 | 278 | bool Impl_ListBox(const std::string& label, int& current_item, const std::vector& items, int height_in_items = -1) 279 | { 280 | std::vector vec_str; for (const auto& bv : items) vec_str.emplace_back(boxed_cast(bv)); 281 | auto getter = [](void* data, int idx, const char** out_text) -> bool { *out_text = static_cast*>(data)->at(idx).c_str(); return *out_text; }; 282 | return ListBox(label.c_str(), (int*)¤t_item, getter, (void*)&vec_str, (int)items.size(), height_in_items); 283 | } 284 | 285 | #pragma endregion Helper functions 286 | 287 | ModulePtr ImGui_GetChaiScriptModule() 288 | { 289 | 290 | ModulePtr mImGui = ModulePtr(new Module()); 291 | ModulePtr mImVec2 = ModulePtr(new Module()); 292 | ModulePtr mImVec4 = ModulePtr(new Module()); 293 | 294 | #pragma region 295 | 296 | utility::add_class( 297 | *mImVec2, 298 | "ImVec2", 299 | { 300 | constructor(), 301 | constructor() 302 | }, 303 | { 304 | { fun(&ImVec2::x), "x" }, 305 | { fun(&ImVec2::y), "y" } 306 | } 307 | ); 308 | 309 | utility::add_class( 310 | *mImVec4, 311 | "ImVec4", 312 | { 313 | constructor(), 314 | constructor() 315 | }, 316 | { 317 | { fun(&ImVec4::x), "x" }, 318 | { fun(&ImVec4::y), "y" }, 319 | { fun(&ImVec4::z), "z" }, 320 | { fun(&ImVec4::w), "w" } 321 | } 322 | ); 323 | 324 | mImGui->add(mImVec2); 325 | mImGui->add(mImVec4); 326 | 327 | #pragma endregion ImGui classes 328 | 329 | #pragma region 330 | 331 | #define IMGUI_REGISTER_CONST(NAME) mImGui->add_global_const(const_var((int)NAME), #NAME); 332 | 333 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoTitleBar); 334 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoResize); 335 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoMove); 336 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoScrollbar); 337 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoScrollWithMouse); 338 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_AlwaysAutoResize); 339 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_ShowBorders); 340 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoSavedSettings); 341 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoInputs); 342 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_MenuBar); 343 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_HorizontalScrollbar); 344 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoFocusOnAppearing); 345 | IMGUI_REGISTER_CONST(ImGuiWindowFlags_NoBringToFrontOnFocus); 346 | 347 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CharsDecimal); 348 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CharsHexadecimal); 349 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CharsUppercase); 350 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CharsNoBlank); 351 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_AutoSelectAll); 352 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_EnterReturnsTrue); 353 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CallbackCompletion); 354 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CallbackHistory); 355 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CallbackAlways); 356 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CallbackCharFilter); 357 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_AllowTabInput); 358 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_CtrlEnterForNewLine); 359 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_NoHorizontalScroll); 360 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_AlwaysInsertMode); 361 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_ReadOnly); 362 | IMGUI_REGISTER_CONST(ImGuiInputTextFlags_Password); 363 | 364 | IMGUI_REGISTER_CONST(ImGuiSelectableFlags_DontClosePopups); 365 | IMGUI_REGISTER_CONST(ImGuiSelectableFlags_SpanAllColumns); 366 | 367 | IMGUI_REGISTER_CONST(ImGuiKey_Tab); 368 | IMGUI_REGISTER_CONST(ImGuiKey_LeftArrow); 369 | IMGUI_REGISTER_CONST(ImGuiKey_RightArrow); 370 | IMGUI_REGISTER_CONST(ImGuiKey_UpArrow); 371 | IMGUI_REGISTER_CONST(ImGuiKey_DownArrow); 372 | IMGUI_REGISTER_CONST(ImGuiKey_PageUp); 373 | IMGUI_REGISTER_CONST(ImGuiKey_PageDown); 374 | IMGUI_REGISTER_CONST(ImGuiKey_Home); 375 | IMGUI_REGISTER_CONST(ImGuiKey_End); 376 | IMGUI_REGISTER_CONST(ImGuiKey_Delete); 377 | IMGUI_REGISTER_CONST(ImGuiKey_Backspace); 378 | IMGUI_REGISTER_CONST(ImGuiKey_Enter); 379 | IMGUI_REGISTER_CONST(ImGuiKey_Escape); 380 | IMGUI_REGISTER_CONST(ImGuiKey_A); 381 | IMGUI_REGISTER_CONST(ImGuiKey_C); 382 | IMGUI_REGISTER_CONST(ImGuiKey_V); 383 | IMGUI_REGISTER_CONST(ImGuiKey_X); 384 | IMGUI_REGISTER_CONST(ImGuiKey_Y); 385 | IMGUI_REGISTER_CONST(ImGuiKey_Z); 386 | 387 | IMGUI_REGISTER_CONST(ImGuiCol_Text); 388 | IMGUI_REGISTER_CONST(ImGuiCol_TextDisabled); 389 | IMGUI_REGISTER_CONST(ImGuiCol_WindowBg); 390 | IMGUI_REGISTER_CONST(ImGuiCol_ChildWindowBg); 391 | IMGUI_REGISTER_CONST(ImGuiCol_Border); 392 | IMGUI_REGISTER_CONST(ImGuiCol_BorderShadow); 393 | IMGUI_REGISTER_CONST(ImGuiCol_FrameBg); 394 | IMGUI_REGISTER_CONST(ImGuiCol_FrameBgHovered); 395 | IMGUI_REGISTER_CONST(ImGuiCol_FrameBgActive); 396 | IMGUI_REGISTER_CONST(ImGuiCol_TitleBg); 397 | IMGUI_REGISTER_CONST(ImGuiCol_TitleBgCollapsed); 398 | IMGUI_REGISTER_CONST(ImGuiCol_TitleBgActive); 399 | IMGUI_REGISTER_CONST(ImGuiCol_MenuBarBg); 400 | IMGUI_REGISTER_CONST(ImGuiCol_ScrollbarBg); 401 | IMGUI_REGISTER_CONST(ImGuiCol_ScrollbarGrab); 402 | IMGUI_REGISTER_CONST(ImGuiCol_ScrollbarGrabHovered); 403 | IMGUI_REGISTER_CONST(ImGuiCol_ScrollbarGrabActive); 404 | IMGUI_REGISTER_CONST(ImGuiCol_ComboBg); 405 | IMGUI_REGISTER_CONST(ImGuiCol_CheckMark); 406 | IMGUI_REGISTER_CONST(ImGuiCol_SliderGrab); 407 | IMGUI_REGISTER_CONST(ImGuiCol_SliderGrabActive); 408 | IMGUI_REGISTER_CONST(ImGuiCol_Button); 409 | IMGUI_REGISTER_CONST(ImGuiCol_ButtonHovered); 410 | IMGUI_REGISTER_CONST(ImGuiCol_ButtonActive); 411 | IMGUI_REGISTER_CONST(ImGuiCol_Header); 412 | IMGUI_REGISTER_CONST(ImGuiCol_HeaderHovered); 413 | IMGUI_REGISTER_CONST(ImGuiCol_HeaderActive); 414 | IMGUI_REGISTER_CONST(ImGuiCol_Column); 415 | IMGUI_REGISTER_CONST(ImGuiCol_ColumnHovered); 416 | IMGUI_REGISTER_CONST(ImGuiCol_ColumnActive); 417 | IMGUI_REGISTER_CONST(ImGuiCol_ResizeGrip); 418 | IMGUI_REGISTER_CONST(ImGuiCol_ResizeGripHovered); 419 | IMGUI_REGISTER_CONST(ImGuiCol_ResizeGripActive); 420 | IMGUI_REGISTER_CONST(ImGuiCol_CloseButton); 421 | IMGUI_REGISTER_CONST(ImGuiCol_CloseButtonHovered); 422 | IMGUI_REGISTER_CONST(ImGuiCol_CloseButtonActive); 423 | IMGUI_REGISTER_CONST(ImGuiCol_PlotLines); 424 | IMGUI_REGISTER_CONST(ImGuiCol_PlotLinesHovered); 425 | IMGUI_REGISTER_CONST(ImGuiCol_PlotHistogram); 426 | IMGUI_REGISTER_CONST(ImGuiCol_PlotHistogramHovered); 427 | IMGUI_REGISTER_CONST(ImGuiCol_TextSelectedBg); 428 | IMGUI_REGISTER_CONST(ImGuiCol_TooltipBg); 429 | IMGUI_REGISTER_CONST(ImGuiCol_ModalWindowDarkening); 430 | 431 | IMGUI_REGISTER_CONST(ImGuiStyleVar_Alpha); 432 | IMGUI_REGISTER_CONST(ImGuiStyleVar_WindowPadding); 433 | IMGUI_REGISTER_CONST(ImGuiStyleVar_WindowRounding); 434 | IMGUI_REGISTER_CONST(ImGuiStyleVar_WindowMinSize); 435 | IMGUI_REGISTER_CONST(ImGuiStyleVar_ChildWindowRounding); 436 | IMGUI_REGISTER_CONST(ImGuiStyleVar_FramePadding); 437 | IMGUI_REGISTER_CONST(ImGuiStyleVar_FrameRounding); 438 | IMGUI_REGISTER_CONST(ImGuiStyleVar_ItemSpacing); 439 | IMGUI_REGISTER_CONST(ImGuiStyleVar_ItemInnerSpacing); 440 | IMGUI_REGISTER_CONST(ImGuiStyleVar_IndentSpacing); 441 | IMGUI_REGISTER_CONST(ImGuiStyleVar_GrabMinSize); 442 | 443 | IMGUI_REGISTER_CONST(ImGuiAlign_Left); 444 | IMGUI_REGISTER_CONST(ImGuiAlign_Center); 445 | IMGUI_REGISTER_CONST(ImGuiAlign_Right); 446 | IMGUI_REGISTER_CONST(ImGuiAlign_Top); 447 | IMGUI_REGISTER_CONST(ImGuiAlign_VCenter); 448 | IMGUI_REGISTER_CONST(ImGuiAlign_Default); 449 | 450 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_Arrow); 451 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_TextInput); 452 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_Move); 453 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_ResizeNS); 454 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_ResizeEW); 455 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_ResizeNESW); 456 | IMGUI_REGISTER_CONST(ImGuiMouseCursor_ResizeNWSE); 457 | 458 | IMGUI_REGISTER_CONST(ImGuiSetCond_Always); 459 | IMGUI_REGISTER_CONST(ImGuiSetCond_Once); 460 | IMGUI_REGISTER_CONST(ImGuiSetCond_FirstUseEver); 461 | IMGUI_REGISTER_CONST(ImGuiSetCond_Appearing); 462 | 463 | #undef IMGUI_REGISTER_CONST 464 | 465 | #pragma endregion ImGui enums 466 | 467 | #pragma region 468 | 469 | mImGui->add(fun([](const std::string& name, bool& opened, ImVec2 size_on_first_use, float bg_alpha, ImGuiWindowFlags flags) -> bool { return Begin(name.c_str(), (bool*)&opened, size_on_first_use, bg_alpha, flags); }), "ImGui_Begin"); 470 | mImGui->add(fun([](const std::string& name, bool& opened, ImVec2 size_on_first_use, float bg_alpha) -> bool { return Begin(name.c_str(), (bool*)&opened, size_on_first_use, bg_alpha); }), "ImGui_Begin"); 471 | mImGui->add(fun([](const std::string& name, bool& opened, ImVec2 size_on_first_use) -> bool { return Begin(name.c_str(), (bool*)&opened, size_on_first_use); }), "ImGui_Begin"); 472 | mImGui->add(fun([](const std::string& name, bool& opened, ImGuiWindowFlags flags) -> bool { return Begin(name.c_str(), (bool*)&opened, flags); }), "ImGui_Begin"); 473 | mImGui->add(fun([](const std::string& name, bool& opened) -> bool { return Begin(name.c_str(), (bool*)&opened); }), "ImGui_Begin"); 474 | mImGui->add(fun(End), "ImGui_End"); 475 | mImGui->add(fun([](const std::string& name, ImVec2 size, bool border, ImGuiWindowFlags extra_flags) -> bool { return BeginChild(name.c_str(), size, border, extra_flags); }), "ImGui_BeginChild"); 476 | mImGui->add(fun([](const std::string& name, ImVec2 size, bool border) -> bool { return BeginChild(name.c_str(), size, border); }), "ImGui_BeginChild"); 477 | mImGui->add(fun([](const std::string& name, ImVec2 size) -> bool { return BeginChild(name.c_str(), size); }), "ImGui_BeginChild"); 478 | mImGui->add(fun([](ImGuiID id, ImVec2 size, bool border, ImGuiWindowFlags extra_flags) -> bool { return BeginChild(id, size, border, extra_flags); }), "ImGui_BeginChild"); 479 | mImGui->add(fun([](ImGuiID id, ImVec2 size, bool border) -> bool { return BeginChild(id, size, border); }), "ImGui_BeginChild"); 480 | mImGui->add(fun([](ImGuiID id, ImVec2 size) -> bool { return BeginChild(id, size); }), "ImGui_BeginChild"); 481 | mImGui->add(fun(EndChild), "ImGui_EndChild"); 482 | mImGui->add(fun(GetContentRegionMax), "ImGui_GetContentRegionMax"); 483 | mImGui->add(fun(GetContentRegionAvail), "ImGui_GetContentRegionAvail"); 484 | mImGui->add(fun(GetContentRegionAvailWidth), "ImGui_GetContentRegionAvailWidth"); 485 | mImGui->add(fun(GetWindowContentRegionMin), "ImGui_GetWindowContentRegionMin"); 486 | mImGui->add(fun(GetWindowContentRegionMax), "ImGui_GetWindowContentRegionMax"); 487 | mImGui->add(fun(GetWindowContentRegionWidth), "ImGui_GetWindowContentRegionWidth"); 488 | // TODO : GetWindowDrawList 489 | // TODO : GetWindowFont 490 | mImGui->add(fun(GetWindowFontSize), "ImGui_GetWindowFontSize"); 491 | mImGui->add(fun(SetWindowFontScale), "ImGui_SetWindowFontScale"); 492 | mImGui->add(fun(GetWindowPos), "ImGui_GetWindowPos"); 493 | mImGui->add(fun(GetWindowSize), "ImGui_GetWindowSize"); 494 | mImGui->add(fun(GetWindowWidth), "ImGui_GetWindowWidth"); 495 | mImGui->add(fun(GetWindowHeight), "ImGui_GetWindowHeight"); 496 | mImGui->add(fun(IsWindowCollapsed), "ImGui_IsWindowCollapsed"); 497 | 498 | mImGui->add(fun([](ImVec2 pos, ImGuiSetCond cond) -> void { SetNextWindowPos(pos, cond); }), "ImGui_SetNextWindowPos"); 499 | mImGui->add(fun([](ImVec2 pos) -> void { SetNextWindowPos(pos); }), "ImGui_SetNextWindowPos"); 500 | mImGui->add(fun(SetNextWindowPosCenter), "ImGui_SetNextWindowPosCenter"); 501 | mImGui->add(fun([](ImVec2 size, ImGuiSetCond cond) -> void { SetNextWindowSize(size, cond); }), "ImGui_SetNextWindowSize"); 502 | mImGui->add(fun([](ImVec2 size) -> void { SetNextWindowSize(size); }), "ImGui_SetNextWindowSize"); 503 | mImGui->add(fun(SetNextWindowContentSize), "ImGui_SetNextWindowContentSize"); 504 | mImGui->add(fun(SetNextWindowContentWidth), "ImGui_SetNextWindowContentWidth"); 505 | mImGui->add(fun([](bool collapsed, ImGuiSetCond cond) -> void { SetNextWindowCollapsed(collapsed, cond); }), "ImGui_SetNextWindowCollapsed"); 506 | mImGui->add(fun([](bool collapsed) -> void { SetNextWindowCollapsed(collapsed); }), "ImGui_SetNextWindowCollapsed"); 507 | mImGui->add(fun(SetNextWindowFocus), "ImGui_SetNextWindowFocus"); 508 | mImGui->add(fun([](ImVec2 pos, ImGuiSetCond cond) -> void { SetWindowPos(pos, cond); }), "ImGui_SetWindowPos"); 509 | mImGui->add(fun([](ImVec2 pos) -> void { SetWindowPos(pos); }), "ImGui_SetWindowPos"); 510 | mImGui->add(fun([](ImVec2 size, ImGuiSetCond cond) -> void { SetWindowSize(size, cond); }), "ImGui_SetWindowSize"); 511 | mImGui->add(fun([](ImVec2 size) -> void { SetWindowSize(size); }), "ImGui_SetWindowSize"); 512 | mImGui->add(fun([](bool collapsed, ImGuiSetCond cond) -> void { SetWindowCollapsed(collapsed, cond); }), "ImGui_SetWindowCollapsed"); 513 | mImGui->add(fun([](bool collapsed) -> void { SetWindowCollapsed(collapsed); }), "ImGui_SetWindowCollapsed"); 514 | mImGui->add(fun([]() -> void { SetWindowFocus(); }), "ImGui_SetWindowFocus"); 515 | mImGui->add(fun([](const std::string& name, ImVec2 pos, ImGuiSetCond cond) -> void { SetWindowPos(name.c_str(), pos, cond); }), "ImGui_SetWindowPos"); 516 | mImGui->add(fun([](const std::string& name, ImVec2 pos) -> void { SetWindowPos(name.c_str(), pos); }), "ImGui_SetWindowPos"); 517 | mImGui->add(fun([](const std::string& name, ImVec2 size, ImGuiSetCond cond) -> void { SetWindowSize(name.c_str(), size, cond); }), "ImGui_SetWindowSize"); 518 | mImGui->add(fun([](const std::string& name, ImVec2 size) -> void { SetWindowSize(name.c_str(), size); }), "ImGui_SetWindowSize"); 519 | mImGui->add(fun([](const std::string& name, bool collapsed, ImGuiSetCond cond) -> void { SetWindowCollapsed(name.c_str(), collapsed, cond); }), "ImGui_SetWindowCollapsed"); 520 | mImGui->add(fun([](const std::string& name, bool collapsed) -> void { SetWindowCollapsed(name.c_str(), collapsed); }), "ImGui_SetWindowCollapsed"); 521 | mImGui->add(fun([](const std::string& name) -> void { SetWindowFocus(name.c_str()); }), "ImGui_SetWindowFocus"); 522 | 523 | mImGui->add(fun(GetScrollX), "ImGui_GetScrollX"); 524 | mImGui->add(fun(GetScrollY), "ImGui_GetScrollY"); 525 | mImGui->add(fun(GetScrollMaxX), "ImGui_GetScrollMaxX"); 526 | mImGui->add(fun(GetScrollMaxY), "ImGui_GetScrollMaxY"); 527 | mImGui->add(fun(SetScrollX), "ImGui_SetScrollX"); 528 | mImGui->add(fun(SetScrollY), "ImGui_SetScrollY"); 529 | mImGui->add(fun([](float center_y_ratio) -> void { SetScrollHere(center_y_ratio); }), "ImGui_SetScrollHere"); 530 | mImGui->add(fun([]() -> void { SetScrollHere(); }), "ImGui_SetScrollHere"); 531 | mImGui->add(fun([](float pos_y, float center_y_ratio) -> void { SetScrollFromPosY(pos_y, center_y_ratio); }), "ImGui_SetScrollFromPosY"); 532 | mImGui->add(fun([](float pos_y) -> void { SetScrollFromPosY(pos_y); }), "ImGui_SetScrollFromPosY"); 533 | mImGui->add(fun([](int offset) -> void { SetKeyboardFocusHere(offset); }), "ImGui_SetKeyboardFocusHere"); 534 | mImGui->add(fun([]() -> void { SetKeyboardFocusHere(); }), "ImGui_SetKeyboardFocusHere"); 535 | // TODO : SetStateStorage 536 | // TODO : GetStateStorage 537 | 538 | #pragma endregion Window 539 | 540 | #pragma region 541 | 542 | // TODO : PushFont 543 | mImGui->add(fun(PopFont), "ImGui_PopFont"); 544 | mImGui->add(fun([](ImGuiCol idx, ImVec4 col) -> void { PushStyleColor(idx, col); }), "ImGui_PushStyleColor"); 545 | mImGui->add(fun([](int count) -> void { PopStyleColor(count); }), "ImGui_PopStyleColor"); 546 | mImGui->add(fun([]() -> void { PopStyleColor(); }), "ImGui_PopStyleColor"); 547 | mImGui->add(fun([](ImGuiStyleVar idx, float val) -> void { PushStyleVar(idx, val); }), "ImGui_PushStyleVar"); 548 | mImGui->add(fun([](ImGuiStyleVar idx, ImVec2 val) -> void { PushStyleVar(idx, val); }), "ImGui_PushStyleVar"); 549 | mImGui->add(fun([](int count) -> void { PopStyleVar(count); }), "ImGui_PopStyleVar"); 550 | mImGui->add(fun([]() -> void { PopStyleVar(); }), "ImGui_PopStyleVar"); 551 | 552 | #pragma endregion Parameters stacks (shared) 553 | 554 | #pragma region 555 | 556 | mImGui->add(fun(PushItemWidth), "ImGui_PushItemWidth"); 557 | mImGui->add(fun(PopItemWidth), "ImGui_PopItemWidth"); 558 | mImGui->add(fun(CalcItemWidth), "ImGui_CalcItemWidth"); 559 | mImGui->add(fun([](float wrap_pos_x) -> void { PushTextWrapPos(wrap_pos_x); }), "ImGui_PushTextWrapPos"); 560 | mImGui->add(fun([]() -> void { PushTextWrapPos(); }), "ImGui_PushTextWrapPos"); 561 | mImGui->add(fun(PopTextWrapPos), "ImGui_PopTextWrapPos"); 562 | mImGui->add(fun(PushAllowKeyboardFocus), "ImGui_PushAllowKeyboardFocus"); 563 | mImGui->add(fun(PopAllowKeyboardFocus), "ImGui_PopAllowKeyboardFocus"); 564 | mImGui->add(fun(PushButtonRepeat), "ImGui_PushButtonRepeat"); 565 | mImGui->add(fun(PopButtonRepeat), "ImGui_PopButtonRepeat"); 566 | 567 | #pragma endregion Parameters stacks (current window) 568 | 569 | #pragma region 570 | 571 | mImGui->add(fun(BeginGroup), "ImGui_BeginGroup"); 572 | mImGui->add(fun(EndGroup), "ImGui_EndGroup"); 573 | mImGui->add(fun(Separator), "ImGui_Separator"); 574 | mImGui->add(fun([](float local_pos_y, float spacing_w) -> void { SameLine(local_pos_y, spacing_w); }), "ImGui_SameLine"); 575 | mImGui->add(fun([](float local_pos_y) -> void { SameLine(local_pos_y); }), "ImGui_SameLine"); 576 | mImGui->add(fun([]() -> void { SameLine(); }), "ImGui_SameLine"); 577 | mImGui->add(fun(Spacing), "ImGui_Spacing"); 578 | mImGui->add(fun([](ImVec2 size) -> void { Dummy(size); }), "ImGui_Dummy"); 579 | mImGui->add(fun(Indent), "ImGui_Indent"); 580 | mImGui->add(fun(Unindent), "ImGui_Unindent"); 581 | mImGui->add(fun([](int count, const std::string& id, bool border) -> void { Columns(count, id.c_str(), border); }), "ImGui_Columns"); 582 | mImGui->add(fun([](int count, const std::string& id) -> void { Columns(count, id.c_str()); }), "ImGui_Columns"); 583 | mImGui->add(fun([](int count) -> void { Columns(count); }), "ImGui_Columns"); 584 | mImGui->add(fun([]() -> void { Columns(); }), "ImGui_Columns"); 585 | mImGui->add(fun(NextColumn), "ImGui_NextColumn"); 586 | mImGui->add(fun(GetColumnIndex), "ImGui_GetColumnIndex"); 587 | mImGui->add(fun([](int column_index) -> void { GetColumnOffset(column_index); }), "ImGui_GetColumnOffset"); 588 | mImGui->add(fun([]() -> void { GetColumnOffset(); }), "ImGui_GetColumnOffset"); 589 | mImGui->add(fun(SetColumnOffset), "ImGui_SetColumnOffset"); 590 | mImGui->add(fun([](int column_index) -> void { GetColumnWidth(column_index); }), "ImGui_GetColumnWidth"); 591 | mImGui->add(fun([]() -> void { GetColumnWidth(); }), "ImGui_GetColumnWidth"); 592 | mImGui->add(fun(GetColumnsCount), "ImGui_GetColumnsCount"); 593 | mImGui->add(fun(ImGui::GetCursorPos), "ImGui_GetCursorPos"); 594 | mImGui->add(fun(GetCursorPosX), "ImGui_GetCursorPosX"); 595 | mImGui->add(fun(GetCursorPosY), "ImGui_GetCursorPosY"); 596 | mImGui->add(fun([](ImVec2 local_pos) -> void { ImGui::SetCursorPos(local_pos); }), "ImGui_SetCursorPos"); 597 | mImGui->add(fun(SetCursorPosX), "ImGui_SetCursorPosX"); 598 | mImGui->add(fun(SetCursorPosY), "ImGui_SetCursorPosY"); 599 | mImGui->add(fun(GetCursorStartPos), "ImGui_GetCursorStartPos"); 600 | mImGui->add(fun(GetCursorPosY), "ImGui_GetCursorScreenPos"); 601 | mImGui->add(fun([](ImVec2 pos) -> void { ImGui::SetCursorScreenPos(pos); }), "ImGui_SetCursorScreenPos"); 602 | mImGui->add(fun(AlignFirstTextHeightToWidgets), "ImGui_AlignFirstTextHeightToWidgets"); 603 | mImGui->add(fun(GetTextLineHeight), "ImGui_GetTextLineHeight"); 604 | mImGui->add(fun(GetTextLineHeightWithSpacing), "ImGui_GetTextLineHeightWithSpacing"); 605 | mImGui->add(fun(GetCursorPosY), "ImGui_GetItemsLineHeightWithSpacing"); 606 | 607 | #pragma endregion Cursor / Layout 608 | 609 | #pragma region 610 | 611 | mImGui->add(fun([](const std::string& str_id) -> void { PushID(str_id.c_str()); }), "ImGui_PushID"); 612 | mImGui->add(fun([](const std::string& str_id_begin, const std::string& str_id_end) -> void { PushID(str_id_begin.c_str(), str_id_end.c_str()); }), "ImGui_PushID"); 613 | mImGui->add(fun([](int int_id) -> void { PushID(int_id); }), "ImGui_PushID"); 614 | mImGui->add(fun(PopID), "ImGui_PopID"); 615 | mImGui->add(fun([](const std::string& str_id) -> ImGuiID { return GetID(str_id.c_str()); }), "ImGui_GetID"); 616 | mImGui->add(fun([](const std::string& str_id_begin, const std::string& str_id_end) -> ImGuiID { return GetID(str_id_begin.c_str(), str_id_end.c_str()); }), "ImGui_GetID"); 617 | 618 | #pragma endregion ID scopes 619 | 620 | #pragma region 621 | 622 | mImGui->add(fun([](const std::string& text) -> void { Text(text.c_str()); }), "ImGui_Text"); 623 | mImGui->add(fun([](ImVec4 col, const std::string& text) -> void { TextColored(col, text.c_str()); }), "ImGui_TextColored"); 624 | mImGui->add(fun([](const std::string& text) -> void { TextDisabled(text.c_str()); }), "ImGui_TextDisabled"); 625 | mImGui->add(fun([](const std::string& text) -> void { TextWrapped(text.c_str()); }), "ImGui_TextWrapped"); 626 | mImGui->add(fun([](const std::string& label, const std::string& text) -> void { LabelText(label.c_str(), text.c_str()); }), "ImGui_TextWrapped"); 627 | mImGui->add(fun(Bullet), "ImGui_Bullet"); 628 | mImGui->add(fun([](const std::string& text) -> void { BulletText(text.c_str()); }), "ImGui_BulletText"); 629 | mImGui->add(fun([](const std::string& text, ImVec2 size) -> void { Button(text.c_str(), size); }), "ImGui_Button"); 630 | mImGui->add(fun([](const std::string& text) -> bool { return Button(text.c_str()); }), "ImGui_Button"); 631 | mImGui->add(fun([](const std::string& text) -> bool { return SmallButton(text.c_str()); }), "ImGui_SmallButton"); 632 | mImGui->add(fun([](const std::string& str_id, ImVec2 size) -> void { InvisibleButton(str_id.c_str(), size); }), "ImGui_InvisibleButton"); 633 | // TODO : Image 634 | // TODO : ImageButton 635 | mImGui->add(fun([](const std::string& label, const std::string& str_id, bool display_frame, bool default_open) -> bool { return CollapsingHeader(label.c_str(), str_id.c_str(), display_frame, default_open); }), "ImGui_CollapsingHeader"); 636 | mImGui->add(fun([](const std::string& label, const std::string& str_id, bool display_frame) -> bool { return CollapsingHeader(label.c_str(), str_id.c_str(), display_frame); }), "ImGui_CollapsingHeader"); 637 | mImGui->add(fun([](const std::string& label, const std::string& str_id) -> bool { return CollapsingHeader(label.c_str(), str_id.c_str()); }), "ImGui_CollapsingHeader"); 638 | mImGui->add(fun([](const std::string& label) -> bool { return CollapsingHeader(label.c_str()); }), "ImGui_CollapsingHeader"); 639 | mImGui->add(fun([](const std::string& label, bool& v) -> bool { return Checkbox(label.c_str(), (bool*)&v); }), "ImGui_Checkbox"); 640 | mImGui->add(fun([](const std::string& label, unsigned int& flags, unsigned int flags_value) -> bool { return CheckboxFlags(label.c_str(), (unsigned int*)&flags, flags_value); }), "ImGui_CheckboxFlags"); 641 | mImGui->add(fun([](const std::string& label, bool active) -> bool { return RadioButton(label.c_str(), active); }), "ImGui_RadioButton"); 642 | mImGui->add(fun([](const std::string& label, int& v, int v_button) -> bool { return RadioButton(label.c_str(), (int*)&v, v_button); }), "ImGui_RadioButton"); 643 | mImGui->add(fun([](const std::string& label, int& current_item, const std::vector& items, int height_in_items) -> bool { return Impl_Combo(label, current_item, items, height_in_items); }), "ImGui_Combo"); 644 | mImGui->add(fun([](const std::string& label, int& current_item, const std::vector& items) -> bool { return Impl_Combo(label, current_item, items); }), "ImGui_Combo"); 645 | mImGui->add(fun([](ImVec4 col, bool smalll_height, bool outline_border) -> bool { return ColorButton(col, smalll_height, outline_border); }), "ImGui_ColorButton"); 646 | mImGui->add(fun([](ImVec4 col, bool smalll_height) -> bool { return ColorButton(col, smalll_height); }), "ImGui_ColorButton"); 647 | mImGui->add(fun([](ImVec4 col) -> bool { return ColorButton(col); }), "ImGui_ColorButton"); 648 | mImGui->add(fun([](const std::string& label, const std::vector& items) -> bool { return Impl_ColorEdit3(label, items); }), "ImGui_ColorEdit3"); 649 | mImGui->add(fun([](const std::string& label, const std::vector& items, bool show_alpha) -> bool { return Impl_ColorEdit4(label, items, show_alpha); }), "ImGui_ColorEdit4"); 650 | mImGui->add(fun([](const std::string& label, const std::vector& items) -> bool { return Impl_ColorEdit4(label, items); }), "ImGui_ColorEdit4"); 651 | mImGui->add(fun(ColorEditMode), "ImGui_ColorEditMode"); 652 | // TODO : PlotLines 653 | // TODO : PlotHistogram 654 | 655 | #pragma endregion Widgets 656 | 657 | #pragma region 658 | 659 | mImGui->add(fun([](const std::string& label, float& v, float v_speed, float v_min, float v_max, const std::string& display_format, float power) -> bool { return DragFloat(label.c_str(), (float*)&v, v_speed, v_min, v_max, display_format.c_str(), power); }), "ImGui_DragFloat"); 660 | mImGui->add(fun([](const std::string& label, float& v, float v_speed, float v_min, float v_max, const std::string& display_format) -> bool { return DragFloat(label.c_str(), (float*)&v, v_speed, v_min, v_max, display_format.c_str()); }), "ImGui_DragFloat"); 661 | mImGui->add(fun([](const std::string& label, float& v, float v_speed, float v_min, float v_max) -> bool { return DragFloat(label.c_str(), (float*)&v, v_speed, v_min, v_max); }), "ImGui_DragFloat"); 662 | mImGui->add(fun([](const std::string& label, float& v, float v_speed, float v_min) -> bool { return DragFloat(label.c_str(), (float*)&v, v_speed, v_min); }), "ImGui_DragFloat"); 663 | mImGui->add(fun([](const std::string& label, float& v, float v_speed) -> bool { return DragFloat(label.c_str(), (float*)&v, v_speed); }), "ImGui_DragFloat"); 664 | mImGui->add(fun([](const std::string& label, float& v) -> bool { return DragFloat(label.c_str(), (float*)&v); }), "ImGui_DragFloat"); 665 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max, const std::string& display_format, float power) -> bool { return Impl_DragFloat2(label, v, v_speed, v_min, v_max, display_format, power); }), "ImGui_DragFloat2"); 666 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max, const std::string& display_format) -> bool { return Impl_DragFloat2(label, v, v_speed, v_min, v_max, display_format); }), "ImGui_DragFloat2"); 667 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max) -> bool { return Impl_DragFloat2(label, v, v_speed, v_min, v_max); }), "ImGui_DragFloat2"); 668 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min) -> bool { return Impl_DragFloat2(label, v, v_speed, v_min); }), "ImGui_DragFloat2"); 669 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed) -> bool { return Impl_DragFloat2(label, v, v_speed); }), "ImGui_DragFloat2"); 670 | mImGui->add(fun([](const std::string& label, const std::vector& v) -> bool { return Impl_DragFloat2(label, v); }), "ImGui_DragFloat2"); 671 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max, const std::string& display_format, float power) -> bool { return Impl_DragFloat3(label, v, v_speed, v_min, v_max, display_format, power); }), "ImGui_DragFloat3"); 672 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max, const std::string& display_format) -> bool { return Impl_DragFloat3(label, v, v_speed, v_min, v_max, display_format); }), "ImGui_DragFloat3"); 673 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max) -> bool { return Impl_DragFloat3(label, v, v_speed, v_min, v_max); }), "ImGui_DragFloat3"); 674 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min) -> bool { return Impl_DragFloat3(label, v, v_speed, v_min); }), "ImGui_DragFloat3"); 675 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed) -> bool { return Impl_DragFloat3(label, v, v_speed); }), "ImGui_DragFloat3"); 676 | mImGui->add(fun([](const std::string& label, const std::vector& v) -> bool { return Impl_DragFloat3(label, v); }), "ImGui_DragFloat3"); 677 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max, const std::string& display_format, float power) -> bool { return Impl_DragFloat4(label, v, v_speed, v_min, v_max, display_format, power); }), "ImGui_DragFloat4"); 678 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max, const std::string& display_format) -> bool { return Impl_DragFloat4(label, v, v_speed, v_min, v_max, display_format); }), "ImGui_DragFloat4"); 679 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min, float v_max) -> bool { return Impl_DragFloat4(label, v, v_speed, v_min, v_max); }), "ImGui_DragFloat4"); 680 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed, float v_min) -> bool { return Impl_DragFloat4(label, v, v_speed, v_min); }), "ImGui_DragFloat4"); 681 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_speed) -> bool { return Impl_DragFloat4(label, v, v_speed); }), "ImGui_DragFloat4"); 682 | mImGui->add(fun([](const std::string& label, const std::vector& v) -> bool { return Impl_DragFloat4(label, v); }), "ImGui_DragFloat4"); 683 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max, float v_speed, float v_min, float v_max, const std::string& display_format, const std::string& display_format_max, float power) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max, v_speed, v_min, v_max, display_format.c_str(), display_format_max.c_str(), power); }), "ImGui_DragFloatRange2"); 684 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max, float v_speed, float v_min, float v_max, const std::string& display_format, const std::string& display_format_max) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max, v_speed, v_min, v_max, display_format.c_str(), display_format_max.c_str()); }), "ImGui_DragFloatRange2"); 685 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max, float v_speed, float v_min, float v_max, const std::string& display_format) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max, v_speed, v_min, v_max, display_format.c_str()); }), "ImGui_DragFloatRange2"); 686 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max, float v_speed, float v_min, float v_max) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max, v_speed, v_min, v_max); }), "ImGui_DragFloatRange2"); 687 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max, float v_speed, float v_min) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max, v_speed, v_min); }), "ImGui_DragFloatRange2"); 688 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max, float v_speed) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max, v_speed); }), "ImGui_DragFloatRange2"); 689 | mImGui->add(fun([](const std::string& label, float& v_current_min, float& v_current_max) -> bool { return DragFloatRange2(label.c_str(), (float*)&v_current_min, (float*)&v_current_max); }), "ImGui_DragFloatRange2"); 690 | mImGui->add(fun([](const std::string& label, int& v, int v_speed, int v_min, int v_max, const std::string& display_format) -> bool { return DragInt(label.c_str(), (int*)&v, v_speed, v_min, v_max, display_format.c_str()); }), "ImGui_DragInt"); 691 | mImGui->add(fun([](const std::string& label, int& v, int v_speed, int v_min, int v_max) -> bool { return DragInt(label.c_str(), (int*)&v, v_speed, v_min, v_max); }), "ImGui_DragInt"); 692 | mImGui->add(fun([](const std::string& label, int& v, int v_speed, int v_min) -> bool { return DragInt(label.c_str(), (int*)&v, v_speed, v_min); }), "ImGui_DragInt"); 693 | mImGui->add(fun([](const std::string& label, int& v, int v_speed) -> bool { return DragInt(label.c_str(), (int*)&v, v_speed); }), "ImGui_DragInt"); 694 | mImGui->add(fun([](const std::string& label, int& v) -> bool { return DragInt(label.c_str(), (int*)&v); }), "ImGui_DragInt"); 695 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min, int v_max, const std::string& display_format) -> bool { return Impl_DragInt2(label, v, v_speed, v_min, v_max, display_format); }), "ImGui_DragInt2"); 696 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min, int v_max) -> bool { return Impl_DragInt2(label, v, v_speed, v_min, v_max); }), "ImGui_DragInt2"); 697 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min) -> bool { return Impl_DragInt2(label, v, v_speed, v_min); }), "ImGui_DragInt2"); 698 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed) -> bool { return Impl_DragInt2(label, v, v_speed); }), "ImGui_DragInt2"); 699 | mImGui->add(fun([](const std::string& label, const std::vector& v) -> bool { return Impl_DragInt2(label, v); }), "ImGui_DragInt2"); 700 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min, int v_max, const std::string& display_format) -> bool { return Impl_DragInt3(label, v, v_speed, v_min, v_max, display_format); }), "ImGui_DragInt3"); 701 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min, int v_max) -> bool { return Impl_DragInt3(label, v, v_speed, v_min, v_max); }), "ImGui_DragInt3"); 702 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min) -> bool { return Impl_DragInt3(label, v, v_speed, v_min); }), "ImGui_DragInt3"); 703 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed) -> bool { return Impl_DragInt3(label, v, v_speed); }), "ImGui_DragInt3"); 704 | mImGui->add(fun([](const std::string& label, const std::vector& v) -> bool { return Impl_DragInt3(label, v); }), "ImGui_DragInt3"); 705 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min, int v_max, const std::string& display_format) -> bool { return Impl_DragInt4(label, v, v_speed, v_min, v_max, display_format); }), "ImGui_DragInt4"); 706 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min, int v_max) -> bool { return Impl_DragInt4(label, v, v_speed, v_min, v_max); }), "ImGui_DragInt4"); 707 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed, int v_min) -> bool { return Impl_DragInt4(label, v, v_speed, v_min); }), "ImGui_DragInt4"); 708 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_speed) -> bool { return Impl_DragInt4(label, v, v_speed); }), "ImGui_DragInt4"); 709 | mImGui->add(fun([](const std::string& label, const std::vector& v) -> bool { return Impl_DragInt4(label, v); }), "ImGui_DragInt4"); 710 | mImGui->add(fun([](const std::string& label, int& v_current_min, int& v_current_max, float v_speed, int v_min, int v_max, const std::string& display_format, const std::string& display_format_max) -> bool { return DragIntRange2(label.c_str(), (int*)&v_current_min, (int*)&v_current_max, v_speed, v_min, v_max, display_format.c_str(), display_format_max.c_str()); }), "ImGui_DragIntRange2"); 711 | mImGui->add(fun([](const std::string& label, int& v_current_min, int& v_current_max, float v_speed, int v_min, int v_max, const std::string& display_format) -> bool { return DragIntRange2(label.c_str(), (int*)&v_current_min, (int*)&v_current_max, v_speed, v_min, v_max, display_format.c_str()); }), "ImGui_DragIntRange2"); 712 | mImGui->add(fun([](const std::string& label, int& v_current_min, int& v_current_max, float v_speed, int v_min, int v_max) -> bool { return DragIntRange2(label.c_str(), (int*)&v_current_min, (int*)&v_current_max, v_speed, v_min, v_max); }), "ImGui_DragIntRange2"); 713 | mImGui->add(fun([](const std::string& label, int& v_current_min, int& v_current_max, float v_speed, int v_min) -> bool { return DragIntRange2(label.c_str(), (int*)&v_current_min, (int*)&v_current_max, v_speed, v_min); }), "ImGui_DragIntRange2"); 714 | mImGui->add(fun([](const std::string& label, int& v_current_min, int& v_current_max, float v_speed) -> bool { return DragIntRange2(label.c_str(), (int*)&v_current_min, (int*)&v_current_max, v_speed); }), "ImGui_DragIntRange2"); 715 | mImGui->add(fun([](const std::string& label, int& v_current_min, int& v_current_max) -> bool { return DragIntRange2(label.c_str(), (int*)&v_current_min, (int*)&v_current_max); }), "ImGui_DragIntRange2"); 716 | 717 | #pragma endregion Widgets: Drags 718 | 719 | #pragma region 720 | 721 | mImGui->add(fun([](const std::string& label, std::string& text, int max_size, ImGuiInputTextFlags flags) -> bool { return Impl_InputText(label, text, max_size, flags); }), "ImGui_InputText"); 722 | mImGui->add(fun([](const std::string& label, std::string& text, int max_size) -> bool { return Impl_InputText(label, text, max_size); }), "ImGui_InputText"); 723 | mImGui->add(fun([](const std::string& label, std::string& text) -> bool { return Impl_InputText(label, text); }), "ImGui_InputText"); 724 | mImGui->add(fun([](const std::string& label, std::string& text, int max_size, ImVec2 size, ImGuiInputTextFlags flags) -> bool { return Impl_InputTextMultine(label, text, max_size, size, flags); }), "ImGui_InputTextMultiline"); 725 | mImGui->add(fun([](const std::string& label, std::string& text, int max_size, ImVec2 size) -> bool { return Impl_InputTextMultine(label, text, max_size, size); }), "ImGui_InputTextMultiline"); 726 | mImGui->add(fun([](const std::string& label, std::string& text, int max_size) -> bool { return Impl_InputTextMultine(label, text); }), "ImGui_InputTextMultiline"); 727 | mImGui->add(fun([](const std::string& label, std::string& text) -> bool { return Impl_InputTextMultine(label, text); }), "ImGui_InputTextMultiline"); 728 | mImGui->add(fun([](const std::string& label, float& v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags) -> bool { return InputFloat(label.c_str(), (float*)&v, step, step_fast, decimal_precision, extra_flags); }), "ImGui_InputFloat"); 729 | mImGui->add(fun([](const std::string& label, float& v, float step, float step_fast, int decimal_precision) -> bool { return InputFloat(label.c_str(), (float*)&v, step, step_fast, decimal_precision); }), "ImGui_InputFloat"); 730 | mImGui->add(fun([](const std::string& label, float& v, float step, float step_fast) -> bool { return InputFloat(label.c_str(), (float*)&v, step, step_fast); }), "ImGui_InputFloat"); 731 | mImGui->add(fun([](const std::string& label, float& v, float step) -> bool { return InputFloat(label.c_str(), (float*)&v); }), "ImGui_InputFloat"); 732 | mImGui->add(fun([](const std::string& label, float& v) -> bool { return InputFloat(label.c_str(), (float*)&v); }), "ImGui_InputFloat"); 733 | mImGui->add(fun([](const std::string& label, const std::vector& items, int decimal_precision, ImGuiInputTextFlags extra_flags) -> bool { return Impl_InputFloat2(label, items, decimal_precision, extra_flags); }), "ImGui_InputFloat2"); 734 | mImGui->add(fun([](const std::string& label, const std::vector& items, int decimal_precision) -> bool { return Impl_InputFloat2(label, items, decimal_precision); }), "ImGui_InputFloat2"); 735 | mImGui->add(fun([](const std::string& label, const std::vector& items) -> bool { return Impl_InputFloat2(label, items); }), "ImGui_InputFloat2"); 736 | mImGui->add(fun([](const std::string& label, const std::vector& items, int decimal_precision, ImGuiInputTextFlags extra_flags) -> bool { return Impl_InputFloat3(label, items, decimal_precision, extra_flags); }), "ImGui_InputFloat3"); 737 | mImGui->add(fun([](const std::string& label, const std::vector& items, int decimal_precision) -> bool { return Impl_InputFloat3(label, items, decimal_precision); }), "ImGui_InputFloat3"); 738 | mImGui->add(fun([](const std::string& label, const std::vector& items) -> bool { return Impl_InputFloat3(label, items); }), "ImGui_InputFloat3"); 739 | mImGui->add(fun([](const std::string& label, const std::vector& items, int decimal_precision, ImGuiInputTextFlags extra_flags) -> bool { return Impl_InputFloat4(label, items, decimal_precision, extra_flags); }), "ImGui_InputFloat4"); 740 | mImGui->add(fun([](const std::string& label, const std::vector& items, int decimal_precision) -> bool { return Impl_InputFloat4(label, items, decimal_precision); }), "ImGui_InputFloat4"); 741 | mImGui->add(fun([](const std::string& label, const std::vector& items) -> bool { return Impl_InputFloat4(label, items); }), "ImGui_InputFloat4"); 742 | mImGui->add(fun([](const std::string& label, int& v, int step, int step_fast, ImGuiInputTextFlags extra_flags) -> bool { return InputInt(label.c_str(), (int*)&v, step, step_fast, extra_flags); }), "ImGui_InputInt"); 743 | mImGui->add(fun([](const std::string& label, int& v, int step, int step_fast) -> bool { return InputInt(label.c_str(), (int*)&v, step, step_fast); }), "ImGui_InputInt"); 744 | mImGui->add(fun([](const std::string& label, int& v, int step) -> bool { return InputInt(label.c_str(), (int*)&v, step); }), "ImGui_InputInt"); 745 | mImGui->add(fun([](const std::string& label, int& v) -> bool { return InputInt(label.c_str(), (int*)&v); }), "ImGui_InputInt"); 746 | 747 | #pragma endregion Widgets: Input 748 | 749 | #pragma region 750 | 751 | mImGui->add(fun([](const std::string& label, float& v, float v_min, float v_max, const std::string& display_format, float power) -> bool { return SliderFloat(label.c_str(), (float*)&v, v_min, v_max, display_format.c_str(), power); }), "ImGui_SliderFloat"); 752 | mImGui->add(fun([](const std::string& label, float& v, float v_min, float v_max, const std::string& display_format) -> bool { return SliderFloat(label.c_str(), (float*)&v, v_min, v_max, display_format.c_str()); }), "ImGui_SliderFloat"); 753 | mImGui->add(fun([](const std::string& label, float& v, float v_min, float v_max) -> bool { return SliderFloat(label.c_str(), (float*)&v, v_min, v_max); }), "ImGui_SliderFloat"); 754 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max, const std::string& display_format, float power) -> bool { return Impl_SliderFloat2(label, v, v_min, v_max, display_format, power); }), "ImGui_SliderFloat2"); 755 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max, const std::string& display_format) -> bool { return Impl_SliderFloat2(label, v, v_min, v_max, display_format); }), "ImGui_SliderFloat2"); 756 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max) -> bool { return Impl_SliderFloat2(label, v, v_min, v_max); }), "ImGui_SliderFloat2"); 757 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max, const std::string& display_format, float power) -> bool { return Impl_SliderFloat3(label, v, v_min, v_max, display_format, power); }), "ImGui_SliderFloat3"); 758 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max, const std::string& display_format) -> bool { return Impl_SliderFloat3(label, v, v_min, v_max, display_format); }), "ImGui_SliderFloat3"); 759 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max) -> bool { return Impl_SliderFloat3(label, v, v_min, v_max); }), "ImGui_SliderFloat3"); 760 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max, const std::string& display_format, float power) -> bool { return Impl_SliderFloat4(label, v, v_min, v_max, display_format, power); }), "ImGui_SliderFloat4"); 761 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max, const std::string& display_format) -> bool { return Impl_SliderFloat4(label, v, v_min, v_max, display_format); }), "ImGui_SliderFloat4"); 762 | mImGui->add(fun([](const std::string& label, const std::vector& v, float v_min, float v_max) -> bool { return Impl_SliderFloat4(label, v, v_min, v_max); }), "ImGui_SliderFloat4"); 763 | mImGui->add(fun([](const std::string& label, int& v, int v_min, int v_max, const std::string& display_format) -> bool { return SliderInt(label.c_str(), (int*)&v, v_min, v_max, display_format.c_str()); }), "ImGui_SliderInt"); 764 | mImGui->add(fun([](const std::string& label, int& v, int v_min, int v_max) -> bool { return SliderInt(label.c_str(), (int*)&v, v_min, v_max); }), "ImGui_SliderInt"); 765 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_min, int v_max, const std::string& display_format) -> bool { return Impl_SliderInt2(label, v, v_min, v_max, display_format); }), "ImGui_SliderInt2"); 766 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_min, int v_max) -> bool { return Impl_SliderInt2(label, v, v_min, v_max); }), "ImGui_SliderInt2"); 767 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_min, int v_max, const std::string& display_format) -> bool { return Impl_SliderInt3(label, v, v_min, v_max, display_format); }), "ImGui_SliderInt3"); 768 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_min, int v_max) -> bool { return Impl_SliderInt3(label, v, v_min, v_max); }), "ImGui_SliderInt3"); 769 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_min, int v_max, const std::string& display_format) -> bool { return Impl_SliderInt4(label, v, v_min, v_max, display_format); }), "ImGui_SliderInt4"); 770 | mImGui->add(fun([](const std::string& label, const std::vector& v, int v_min, int v_max) -> bool { return Impl_SliderInt4(label, v, v_min, v_max); }), "ImGui_SliderInt4"); 771 | mImGui->add(fun([](const std::string& label, ImVec2 size, float& v, float v_min, float v_max, std::string& display_format, float power) -> bool { return VSliderFloat(label.c_str(), size, (float*)&v, v_min, v_max, display_format.c_str(), power); }), "ImGui_VSliderFloat"); 772 | mImGui->add(fun([](const std::string& label, ImVec2 size, float& v, float v_min, float v_max, std::string& display_format) -> bool { return VSliderFloat(label.c_str(), size, (float*)&v, v_min, v_max, display_format.c_str()); }), "ImGui_VSliderFloat"); 773 | mImGui->add(fun([](const std::string& label, ImVec2 size, float& v, float v_min, float v_max) -> bool { return VSliderFloat(label.c_str(), size, (float*)&v, v_min, v_max); }), "ImGui_VSliderFloat"); 774 | mImGui->add(fun([](const std::string& label, ImVec2 size, int& v, int v_min, int v_max, std::string& display_format) -> bool { return VSliderInt(label.c_str(), size, (int*)&v, v_min, v_max, display_format.c_str()); }), "ImGui_VSliderInt"); 775 | mImGui->add(fun([](const std::string& label, ImVec2 size, int& v, int v_min, int v_max) -> bool { return VSliderInt(label.c_str(), size, (int*)&v, v_min, v_max); }), "ImGui_VSliderInt"); 776 | 777 | #pragma endregion Widgets: Sliders 778 | 779 | #pragma region 780 | 781 | mImGui->add(fun([](const std::string& str_id) -> bool { return TreeNode(str_id.c_str()); }), "ImGui_TreeNode"); 782 | mImGui->add(fun([](const std::string& str_id, const std::string& text) -> bool { return TreeNode(str_id.c_str(), text.c_str()); }), "ImGui_TreeNode"); 783 | mImGui->add(fun([](const std::string& str_id) -> void { TreeNode(str_id.size() ? str_id.c_str() : nullptr); }), "ImGui_TreeNodePush"); 784 | mImGui->add(fun([]() -> void { TreePop(); }), "ImGui_TreePop"); 785 | mImGui->add(fun([](bool opened, ImGuiSetCond cond) -> void { SetNextTreeNodeOpened(opened, cond); }), "ImGui_SetNextTreeNodeOpened"); 786 | mImGui->add(fun([](bool opened) -> void { SetNextTreeNodeOpened(opened); }), "ImGui_SetNextTreeNodeOpened"); 787 | 788 | #pragma endregion Widgets: Trees 789 | 790 | #pragma region 791 | 792 | mImGui->add(fun([](const std::string& label, bool selected, ImGuiSelectableFlags flags, ImVec2 size) -> bool { return Selectable(label.c_str(), selected, flags, size); }), "ImGui_Selectable"); 793 | mImGui->add(fun([](const std::string& label, bool selected, ImGuiSelectableFlags flags) -> bool { return Selectable(label.c_str(), selected, flags); }), "ImGui_Selectable"); 794 | mImGui->add(fun([](const std::string& label, bool selected) -> bool { return Selectable(label.c_str(), selected); }), "ImGui_Selectable"); 795 | mImGui->add(fun([](const std::string& label) -> bool { return Selectable(label.c_str()); }), "ImGui_Selectable"); 796 | mImGui->add(fun([](const std::string& label, bool& p_selected, ImGuiSelectableFlags flags, ImVec2 size) -> bool { return Selectable(label.c_str(), (bool*)&p_selected, flags, size); }), "ImGui_Selectable"); 797 | mImGui->add(fun([](const std::string& label, bool& p_selected, ImGuiSelectableFlags flags) -> bool { return Selectable(label.c_str(), (bool*)&p_selected, flags); }), "ImGui_Selectable"); 798 | mImGui->add(fun([](const std::string& label, bool& p_selected) -> bool { return Selectable(label.c_str(), (bool*)&p_selected); }), "ImGui_Selectable"); 799 | mImGui->add(fun([](const std::string& label, int& current_item, const std::vector& items, int height_in_items) -> bool { return Impl_ListBox(label, current_item, items, height_in_items); }), "ImGui_ListBox"); 800 | mImGui->add(fun([](const std::string& label, int& current_item, const std::vector& items) -> bool { return Impl_ListBox(label, current_item, items); }), "ImGui_ListBox"); 801 | mImGui->add(fun([](const std::string& label, ImVec2 size) -> bool { return ListBoxHeader(label.c_str(), size); }), "ImGui_ListBoxHeader"); 802 | mImGui->add(fun([](const std::string& label) -> bool { return ListBoxHeader(label.c_str()); }), "ImGui_ListBoxHeader"); 803 | mImGui->add(fun([](const std::string& label, int items_count, int height_in_items) -> bool { return ListBoxHeader(label.c_str(), items_count, height_in_items); }), "ImGui_ListBoxHeader"); 804 | mImGui->add(fun([](const std::string& label, int items_count) -> bool { return ListBoxHeader(label.c_str(), items_count); }), "ImGui_ListBoxHeader"); 805 | mImGui->add(fun([]() -> void { ListBoxFooter(); }), "ImGui_ListBoxFooter"); 806 | 807 | #pragma endregion Widgets: Selectable / Lists 808 | 809 | #pragma region 810 | 811 | mImGui->add(fun([](const std::string& label) -> void { SetTooltip(label.c_str()); }), "ImGui_SetTooltip"); 812 | mImGui->add(fun(BeginTooltip), "ImGui_BeginTooltip"); 813 | mImGui->add(fun(EndTooltip), "ImGui_EndTooltip"); 814 | 815 | #pragma endregion Tooltip 816 | 817 | #pragma region 818 | 819 | mImGui->add(fun(BeginMainMenuBar), "ImGui_BeginMainMenuBar"); 820 | mImGui->add(fun(EndMainMenuBar), "ImGui_EndMainMenuBar"); 821 | mImGui->add(fun(BeginMenuBar), "ImGui_BeginMenuBar"); 822 | mImGui->add(fun(EndMenuBar), "ImGui_EndMenuBar"); 823 | mImGui->add(fun([](const std::string& label, bool enabled) -> bool { return BeginMenu(label.c_str(), enabled); }), "ImGui_BeginMenu"); 824 | mImGui->add(fun([](const std::string& label) -> bool { return BeginMenu(label.c_str()); }), "ImGui_BeginMenu"); 825 | mImGui->add(fun(ImGui::EndMenu), "ImGui_EndMenu"); 826 | mImGui->add(fun([](const std::string& label, std::string& shortcut, bool selected, bool enabled) -> bool { return MenuItem(label.c_str(), shortcut.c_str(), selected, enabled); }), "ImGui_MenuItem"); 827 | mImGui->add(fun([](const std::string& label, std::string& shortcut, bool selected) -> bool { return MenuItem(label.c_str(), shortcut.c_str(), selected); }), "ImGui_MenuItem"); 828 | mImGui->add(fun([](const std::string& label, std::string& shortcut) -> bool { return MenuItem(label.c_str(), shortcut.c_str()); }), "ImGui_MenuItem"); 829 | mImGui->add(fun([](const std::string& label) -> bool { return MenuItem(label.c_str()); }), "ImGui_MenuItem"); 830 | mImGui->add(fun([](const std::string& label, std::string& shortcut, bool& p_selected, bool enabled) -> bool { return MenuItem(label.c_str(), shortcut.c_str(), (bool*)&p_selected, enabled); }), "ImGui_MenuItem"); 831 | mImGui->add(fun([](const std::string& label, std::string& shortcut, bool& p_selected) -> bool { return MenuItem(label.c_str(), shortcut.c_str(), (bool*)&p_selected); }), "ImGui_MenuItem"); 832 | 833 | #pragma endregion Menus 834 | 835 | #pragma region 836 | 837 | mImGui->add(fun([](const std::string& str_id) -> void { OpenPopup(str_id.c_str()); }), "ImGui_OpenPopup"); 838 | mImGui->add(fun([](const std::string& str_id) -> bool { return BeginPopup(str_id.c_str()); }), "ImGui_BeginPopup"); 839 | mImGui->add(fun([](const std::string& name, bool& p_opened, ImGuiWindowFlags extra_flags) -> bool { return BeginPopupModal(name.c_str(), (bool*)&p_opened, extra_flags); }), "ImGui_BeginPopupModal"); 840 | mImGui->add(fun([](const std::string& name, bool& p_opened) -> bool { return BeginPopupModal(name.c_str(), (bool*)&p_opened); }), "ImGui_BeginPopupModal"); 841 | mImGui->add(fun([](const std::string& name) -> bool { return BeginPopupModal(name.c_str()); }), "ImGui_BeginPopupModal"); 842 | mImGui->add(fun([](const std::string& str_id, int mouse_button) -> bool { return BeginPopupContextItem(str_id.c_str(), mouse_button); }), "ImGui_BeginPopupContextItem"); 843 | mImGui->add(fun([](const std::string& str_id) -> bool { return BeginPopupContextItem(str_id.c_str()); }), "ImGui_BeginPopupContextItem"); 844 | mImGui->add(fun([](bool also_over_items, const std::string& str_id, int mouse_button) -> bool { return BeginPopupContextWindow(also_over_items, str_id.c_str(), mouse_button); }), "ImGui_BeginPopupContextWindow"); 845 | mImGui->add(fun([](bool also_over_items, const std::string& str_id) -> bool { return BeginPopupContextWindow(also_over_items, str_id.c_str()); }), "ImGui_BeginPopupContextWindow"); 846 | mImGui->add(fun([](bool also_over_items) -> bool { return BeginPopupContextWindow(also_over_items); }), "ImGui_BeginPopupContextWindow"); 847 | mImGui->add(fun([]() -> bool { return BeginPopupContextWindow(); }), "ImGui_BeginPopupContextWindow"); 848 | mImGui->add(fun([](const std::string& str_id, int mouse_button) -> bool { return BeginPopupContextVoid(str_id.c_str(), mouse_button); }), "ImGui_BeginPopupContextVoid"); 849 | mImGui->add(fun([](const std::string& str_id) -> bool { return BeginPopupContextVoid(str_id.c_str()); }), "ImGui_BeginPopupContextVoid"); 850 | mImGui->add(fun([]() -> bool { return BeginPopupContextVoid(); }), "ImGui_BeginPopupContextVoid"); 851 | mImGui->add(fun(ImGui::EndPopup), "ImGui_EndPopup"); 852 | mImGui->add(fun(ImGui::CloseCurrentPopup), "ImGui_CloseCurrentPopup"); 853 | 854 | #pragma endregion Popup 855 | 856 | #pragma region 857 | 858 | mImGui->add(fun(ImGui::IsItemHovered), "ImGui_IsItemHovered"); 859 | mImGui->add(fun(ImGui::IsItemHoveredRect), "ImGui_IsItemHoveredRect"); 860 | mImGui->add(fun(ImGui::IsItemActive), "ImGui_IsItemActive"); 861 | mImGui->add(fun(ImGui::IsItemVisible), "ImGui_IsItemVisible"); 862 | mImGui->add(fun(ImGui::IsAnyItemHovered), "ImGui_IsAnyItemHovered"); 863 | mImGui->add(fun(ImGui::IsAnyItemActive), "ImGui_IsAnyItemActive"); 864 | mImGui->add(fun(ImGui::GetItemRectMin), "ImGui_GetItemRectMin"); 865 | mImGui->add(fun(ImGui::GetItemRectMax), "ImGui_GetItemRectMax"); 866 | mImGui->add(fun(ImGui::GetItemRectSize), "ImGui_GetItemRectSize"); 867 | mImGui->add(fun(ImGui::IsWindowHovered), "ImGui_IsWindowHovered"); 868 | mImGui->add(fun(ImGui::IsWindowFocused), "ImGui_IsWindowFocused"); 869 | mImGui->add(fun(ImGui::IsRootWindowFocused), "ImGui_IsRootWindowFocused"); 870 | mImGui->add(fun(ImGui::IsRootWindowOrAnyChildFocused), "ImGui_IsRootWindowOrAnyChildFocused"); 871 | mImGui->add(fun([](ImVec2 size) -> bool { return IsRectVisible(size); }), "ImGui_IsRectVisible"); 872 | mImGui->add(fun([](ImVec2 pos) -> bool { return IsPosHoveringAnyWindow(pos); }), "ImGui_IsPosHoveringAnyWindow"); 873 | mImGui->add(fun(ImGui::GetTime), "ImGui_GetTime"); 874 | mImGui->add(fun(ImGui::GetFrameCount), "ImGui_GetFrameCount"); 875 | mImGui->add(fun([](ImGuiCol idx) -> std::string { return std::string(GetStyleColName(idx)); }), "ImGui_GetStyleColName"); 876 | mImGui->add(fun([](ImVec2 pos, bool on_edge, float outward) -> ImVec2 { return CalcItemRectClosestPoint(pos, on_edge, outward); }), "ImGui_CalcItemRectClosestPoint"); 877 | mImGui->add(fun([](ImVec2 pos, bool on_edge) -> ImVec2 { return CalcItemRectClosestPoint(pos, on_edge); }), "ImGui_CalcItemRectClosestPoint"); 878 | mImGui->add(fun([](ImVec2 pos) -> ImVec2 { return CalcItemRectClosestPoint(pos); }), "ImGui_CalcItemRectClosestPoint"); 879 | mImGui->add(fun([](const std::string& text, const std::string& text_end, bool hide_text_after_double_hash, float wrap_width) -> ImVec2 { return CalcTextSize(text.c_str(), text_end.size() ? text_end.c_str() : nullptr, hide_text_after_double_hash, wrap_width); }), "ImGui_CalcTextSize"); 880 | mImGui->add(fun([](const std::string& text, const std::string& text_end, bool hide_text_after_double_hash) -> ImVec2 { return CalcTextSize(text.c_str(), text_end.size() ? text_end.c_str() : nullptr, hide_text_after_double_hash); }), "ImGui_CalcTextSize"); 881 | mImGui->add(fun([](const std::string& text, const std::string& text_end) -> ImVec2 { return CalcTextSize(text.c_str(), text_end.size() ? text_end.c_str() : nullptr); }), "ImGui_CalcTextSize"); 882 | mImGui->add(fun([](const std::string& text) -> ImVec2 { return CalcTextSize(text.c_str()); }), "ImGui_CalcTextSize"); 883 | mImGui->add(fun([](int items_count, float items_height, int& out_items_display_start, int& out_items_display_end) -> void { ImGui::CalcListClipping(items_count, items_height, (int*)&out_items_display_start, (int*)&out_items_display_end); }), "ImGui_CalcListClipping"); 884 | 885 | mImGui->add(fun([](ImGuiID id, ImVec2 size, ImGuiWindowFlags extra_flags) -> bool { return BeginChildFrame(id, size, extra_flags); }), "ImGui_BeginChildFrame"); 886 | mImGui->add(fun([](ImGuiID id, ImVec2 size) -> bool { return BeginChildFrame(id, size); }), "ImGui_BeginChildFrame"); 887 | mImGui->add(fun(ImGui::EndChildFrame), "ImGui_EndChildFrame"); 888 | 889 | mImGui->add(fun(ImGui::ColorConvertU32ToFloat4), "ImGui_ColorConvertU32ToFloat4"); 890 | mImGui->add(fun([](ImVec4 in) -> ImU32 { return ColorConvertFloat4ToU32(in); }), "ImGui_ColorConvertFloat4ToU32"); 891 | mImGui->add(fun([](float r, float g, float b, float& out_h, float& out_s, float& out_v) -> void { ColorConvertRGBtoHSV(r, g, b, out_h, out_s, out_v); }), "ImGui_ColorConvertRGBtoHSV"); 892 | mImGui->add(fun([](float h, float s, float v, float& out_r, float& out_g, float& out_b) -> void { ColorConvertHSVtoRGB(h, s, v, out_r, out_g, out_b); }), "ImGui_ColorConvertHSVtoRGB"); 893 | 894 | #pragma endregion Utilites 895 | 896 | #pragma region 897 | 898 | mImGui->add(fun(ImGui::GetKeyIndex), "ImGui_GetKeyIndex"); 899 | mImGui->add(fun(ImGui::IsKeyDown), "ImGui_IsKeyDown"); 900 | mImGui->add(fun([](int key_index, bool repeat) -> bool { return IsKeyPressed(key_index, repeat); }), "ImGui_IsKeyPressed"); 901 | mImGui->add(fun([](int key_index) -> bool { return IsKeyPressed(key_index); }), "ImGui_IsKeyPressed"); 902 | mImGui->add(fun(ImGui::IsKeyReleased), "ImGui_IsKeyReleased"); 903 | mImGui->add(fun(ImGui::IsMouseDown), "ImGui_IsMouseDown"); 904 | mImGui->add(fun([](int button, bool repeat) -> bool { return IsMouseClicked(button, repeat); }), "ImGui_IsMouseClicked"); 905 | mImGui->add(fun([](int button) -> bool { return IsMouseClicked(button); }), "ImGui_IsMouseClicked"); 906 | mImGui->add(fun(ImGui::IsMouseDoubleClicked), "ImGui_IsMouseDoubleClicked"); 907 | mImGui->add(fun(ImGui::IsMouseReleased), "ImGui_IsMouseReleased"); 908 | mImGui->add(fun(ImGui::IsMouseHoveringWindow), "ImGui_IsMouseHoveringWindow"); 909 | mImGui->add(fun(ImGui::IsMouseDoubleClicked), "ImGui_IsMouseHoveringAnyWindow"); 910 | mImGui->add(fun(ImGui::IsMouseDoubleClicked), "ImGui_IsMouseDoubleClicked"); 911 | mImGui->add(fun([](ImVec2 pos_min, ImVec2 pos_max, bool clip) -> bool { return IsMouseHoveringRect(pos_min, pos_max, clip); }), "ImGui_IsMouseHoveringRect"); 912 | mImGui->add(fun([](ImVec2 pos_min, ImVec2 pos_max) -> bool { return IsMouseHoveringRect(pos_min, pos_max); }), "ImGui_IsMouseHoveringRect"); 913 | mImGui->add(fun([](int button, float lock_threshold) -> bool { return IsMouseDragging(button, lock_threshold); }), "ImGui_IsMouseDragging"); 914 | mImGui->add(fun([](int button) -> bool { return IsMouseDragging(button); }), "ImGui_IsMouseDragging"); 915 | mImGui->add(fun(ImGui::GetMousePos), "ImGui_GetMousePos"); 916 | mImGui->add(fun(ImGui::GetMousePosOnOpeningCurrentPopup), "ImGui_GetMousePosOnOpeningCurrentPopup"); 917 | mImGui->add(fun([](int button, float lock_threshold) -> ImVec2 { return GetMouseDragDelta(button, lock_threshold); }), "ImGui_GetMouseDragDelta"); 918 | mImGui->add(fun([](int button) -> void { ResetMouseDragDelta(button); }), "ImGui_ResetMouseDragDelta"); 919 | mImGui->add(fun([]() -> void { return ResetMouseDragDelta(); }), "ImGui_ResetMouseDragDelta"); 920 | mImGui->add(fun(ImGui::GetMouseCursor), "ImGui_GetMouseCursor"); 921 | mImGui->add(fun(ImGui::SetMouseCursor), "ImGui_SetMouseCursor"); 922 | mImGui->add(fun(ImGui::CaptureKeyboardFromApp), "ImGui_GetMouseCursor"); 923 | mImGui->add(fun(ImGui::CaptureMouseFromApp), "ImGui_CaptureMouseFromApp"); 924 | 925 | #pragma endregion Inputs 926 | 927 | #pragma region 928 | 929 | mImGui->add(fun([]() -> std::string { return std::string(ImGui::GetVersion()); }), "ImGui_GetVersion"); 930 | 931 | #pragma endregion Internal state/context 932 | 933 | return mImGui; 934 | 935 | } --------------------------------------------------------------------------------