mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 15:11:05 +01:00 
			
		
		
		
	Merge branch 'master' into viewport
# Conflicts: # examples/imgui_impl_dx9.cpp # imgui.cpp # imgui.h
This commit is contained in:
		
							
								
								
									
										149
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										149
									
								
								imgui.h
									
									
									
									
									
								
							@@ -16,26 +16,26 @@
 | 
			
		||||
#include "imconfig.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#include <float.h>          // FLT_MAX
 | 
			
		||||
#include <stdarg.h>         // va_list
 | 
			
		||||
#include <stddef.h>         // ptrdiff_t, NULL
 | 
			
		||||
#include <string.h>         // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
 | 
			
		||||
#include <float.h>                  // FLT_MAX
 | 
			
		||||
#include <stdarg.h>                 // va_list
 | 
			
		||||
#include <stddef.h>                 // ptrdiff_t, NULL
 | 
			
		||||
#include <string.h>                 // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
 | 
			
		||||
 | 
			
		||||
#define IMGUI_VERSION       "1.61 WIP"
 | 
			
		||||
#define IMGUI_HAS_VIEWPORT  1 // Viewport WIP branch
 | 
			
		||||
// Version
 | 
			
		||||
#define IMGUI_VERSION               "1.61 WIP"
 | 
			
		||||
#define IMGUI_CHECKVERSION()        ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert))
 | 
			
		||||
#define IMGUI_HAS_VIEWPORT          1 // Viewport WIP branch
 | 
			
		||||
 | 
			
		||||
// Define attributes of all API symbols declarations, e.g. for DLL under Windows.
 | 
			
		||||
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
 | 
			
		||||
#ifndef IMGUI_API
 | 
			
		||||
#define IMGUI_API
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Define assertion handler.
 | 
			
		||||
// Helpers
 | 
			
		||||
#ifndef IM_ASSERT
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#define IM_ASSERT(_EXPR)    assert(_EXPR)
 | 
			
		||||
#define IM_ASSERT(_EXPR)            assert(_EXPR)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Helpers
 | 
			
		||||
#if defined(__clang__) || defined(__GNUC__)
 | 
			
		||||
#define IM_FMTARGS(FMT)             __attribute__((format(printf, FMT, FMT+1))) // Apply printf-style warnings to user functions.
 | 
			
		||||
#define IM_FMTLIST(FMT)             __attribute__((format(printf, FMT, 0)))
 | 
			
		||||
@@ -61,7 +61,7 @@ struct ImDrawVert;                  // A single vertex (20 bytes by default, ove
 | 
			
		||||
struct ImFont;                      // Runtime data for a single font within a parent ImFontAtlas
 | 
			
		||||
struct ImFontAtlas;                 // Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF/OTF font loader
 | 
			
		||||
struct ImFontConfig;                // Configuration data when adding a font or merging fonts
 | 
			
		||||
struct ImColor;                     // Helper functions to create a color that can be converted to either u32 or float4
 | 
			
		||||
struct ImColor;                     // Helper functions to create a color that can be converted to either u32 or float4 (*obsolete* please avoid using)
 | 
			
		||||
struct ImGuiIO;                     // Main configuration and I/O between your application and ImGui
 | 
			
		||||
struct ImGuiOnceUponAFrame;         // Simple helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro
 | 
			
		||||
struct ImGuiStorage;                // Simple custom key value storage
 | 
			
		||||
@@ -117,27 +117,27 @@ typedef unsigned long long ImU64;   // 64-bit unsigned integer
 | 
			
		||||
 | 
			
		||||
struct ImVec2
 | 
			
		||||
{
 | 
			
		||||
    float x, y;
 | 
			
		||||
    ImVec2() { x = y = 0.0f; }
 | 
			
		||||
    float     x, y;
 | 
			
		||||
    ImVec2()  { x = y = 0.0f; }
 | 
			
		||||
    ImVec2(float _x, float _y) { x = _x; y = _y; }
 | 
			
		||||
    float  operator[] (size_t idx) const { IM_ASSERT(idx <= 1); return (&x)[idx]; }    // We very rarely use this [] operator, the assert overhead is fine.
 | 
			
		||||
#ifdef IM_VEC2_CLASS_EXTRA          // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2.
 | 
			
		||||
    IM_VEC2_CLASS_EXTRA
 | 
			
		||||
    float operator[] (size_t i) const { IM_ASSERT(i <= 1); return (&x)[i]; }    // We very rarely use this [] operator, the assert overhead is fine.
 | 
			
		||||
#ifdef IM_VEC2_CLASS_EXTRA
 | 
			
		||||
    IM_VEC2_CLASS_EXTRA     // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec2.
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct ImVec4
 | 
			
		||||
{
 | 
			
		||||
    float x, y, z, w;
 | 
			
		||||
    ImVec4() { x = y = z = w = 0.0f; }
 | 
			
		||||
    float     x, y, z, w;
 | 
			
		||||
    ImVec4()  { x = y = z = w = 0.0f; }
 | 
			
		||||
    ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
 | 
			
		||||
#ifdef IM_VEC4_CLASS_EXTRA          // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec4.
 | 
			
		||||
    IM_VEC4_CLASS_EXTRA
 | 
			
		||||
#ifdef IM_VEC4_CLASS_EXTRA
 | 
			
		||||
    IM_VEC4_CLASS_EXTRA     // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec4.
 | 
			
		||||
#endif
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// ImGui end-user API
 | 
			
		||||
// In a namespace so that user can add extra functions in a separate file (e.g. Value() helpers for your vector or common types)
 | 
			
		||||
// In a namespace so that user can add extra functions in your own separate file (please don't modify imgui.cpp/.h)
 | 
			
		||||
namespace ImGui
 | 
			
		||||
{
 | 
			
		||||
    // Context creation and access 
 | 
			
		||||
@@ -147,6 +147,7 @@ namespace ImGui
 | 
			
		||||
    IMGUI_API void          DestroyContext(ImGuiContext* ctx = NULL);   // NULL = destroy current context
 | 
			
		||||
    IMGUI_API ImGuiContext* GetCurrentContext();
 | 
			
		||||
    IMGUI_API void          SetCurrentContext(ImGuiContext* ctx);
 | 
			
		||||
    IMGUI_API bool          DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert);
 | 
			
		||||
 | 
			
		||||
    // Main
 | 
			
		||||
    IMGUI_API ImGuiIO&      GetIO();
 | 
			
		||||
@@ -340,42 +341,42 @@ namespace ImGui
 | 
			
		||||
    // Widgets: Drags (tip: ctrl+click on a drag box to input with keyboard. manually input values aren't clamped, can go off-bounds)
 | 
			
		||||
    // For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
 | 
			
		||||
    // Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
 | 
			
		||||
    IMGUI_API bool          DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);     // If v_min >= v_max we have no bound
 | 
			
		||||
    IMGUI_API bool          DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          DragFloat3(const char* label, float v[3], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          DragFloat4(const char* label, float v[4], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          DragFloatRange2(const char* label, float* v_current_min, float* v_current_max, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* display_format = "%.3f", const char* display_format_max = NULL, float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          DragInt(const char* label, int* v, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");                                       // If v_min >= v_max we have no bound
 | 
			
		||||
    IMGUI_API bool          DragInt2(const char* label, int v[2], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          DragInt3(const char* label, int v[3], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          DragInt4(const char* label, int v[4], float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          DragIntRange2(const char* label, int* v_current_min, int* v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char* display_format = "%.0f", const char* display_format_max = NULL);
 | 
			
		||||
    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);     // If v_min >= v_max we have no bound
 | 
			
		||||
    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);
 | 
			
		||||
    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);
 | 
			
		||||
    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          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);
 | 
			
		||||
    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 = "%.0f");                                       // If v_min >= v_max we have no bound
 | 
			
		||||
    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 = "%.0f");
 | 
			
		||||
    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 = "%.0f");
 | 
			
		||||
    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 = "%.0f");
 | 
			
		||||
    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 = "%.0f", const char* format_max = NULL);
 | 
			
		||||
 | 
			
		||||
    // Widgets: Input with Keyboard
 | 
			
		||||
    IMGUI_API bool          InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
 | 
			
		||||
    IMGUI_API bool          InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiTextEditCallback callback = NULL, void* user_data = NULL);
 | 
			
		||||
    IMGUI_API bool          InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat2(const char* label, float v[2], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat3(const char* label, float v[3], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat4(const char* label, float v[4], int decimal_precision = -1, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat(const char* label, float* v, float step = 0.0f, float step_fast = 0.0f, const char* format = "%.3f", ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat2(const char* label, float v[2], const char* format = "%.3f", ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat3(const char* label, float v[3], const char* format = "%.3f", ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputFloat4(const char* label, float v[4], const char* format = "%.3f", ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputInt(const char* label, int* v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputInt2(const char* label, int v[2], ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputInt3(const char* label, int v[3], ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputInt4(const char* label, int v[4], ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputDouble(const char* label, double* v, double step = 0.0f, double step_fast = 0.0f, const char* display_format = "%.6f", ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    IMGUI_API bool          InputDouble(const char* label, double* v, double step = 0.0f, double step_fast = 0.0f, const char* format = "%.6f", ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
 | 
			
		||||
    // Widgets: Sliders (tip: ctrl+click on a slider to input with keyboard. manually input values aren't clamped, can go off-bounds)
 | 
			
		||||
    IMGUI_API bool          SliderFloat(const char* label, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);     // adjust display_format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for logarithmic sliders
 | 
			
		||||
    IMGUI_API bool          SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format = "%.3f", float power = 1.0f);     // adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for logarithmic sliders
 | 
			
		||||
    IMGUI_API bool          SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          SliderAngle(const char* label, float* v_rad, float v_degrees_min = -360.0f, float v_degrees_max = +360.0f);
 | 
			
		||||
    IMGUI_API bool          SliderInt(const char* label, int* v, int v_min, int v_max, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
 | 
			
		||||
    IMGUI_API bool          VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt(const char* label, int* v, int v_min, int v_max, const char* format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt2(const char* label, int v[2], int v_min, int v_max, const char* format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* format = "%.0f");
 | 
			
		||||
    IMGUI_API bool          SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* format = "%.0f");
 | 
			
		||||
    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);
 | 
			
		||||
    IMGUI_API bool          VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* format = "%.0f");
 | 
			
		||||
 | 
			
		||||
    // Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.)
 | 
			
		||||
    // Note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can the pass the address of a first float element out of a contiguous structure, e.g. &myvector.x
 | 
			
		||||
@@ -411,9 +412,9 @@ namespace ImGui
 | 
			
		||||
    IMGUI_API bool          Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0));       // "bool* p_selected" point to the selection state (read-write), as a convenient helper.
 | 
			
		||||
    IMGUI_API bool          ListBox(const char* label, int* current_item, const char* const items[], int items_count, int height_in_items = -1);
 | 
			
		||||
    IMGUI_API bool          ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
 | 
			
		||||
    IMGUI_API bool          ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards.
 | 
			
		||||
    IMGUI_API bool          ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. if the function return true, you can output elements then call ListBoxFooter() afterwards.
 | 
			
		||||
    IMGUI_API bool          ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
 | 
			
		||||
    IMGUI_API void          ListBoxFooter();                                                    // terminate the scrolling region
 | 
			
		||||
    IMGUI_API void          ListBoxFooter();                                                    // terminate the scrolling region. only call ListBoxFooter() if ListBoxHeader() returned true!
 | 
			
		||||
 | 
			
		||||
    // Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace)
 | 
			
		||||
    IMGUI_API void          Value(const char* prefix, bool b);
 | 
			
		||||
@@ -546,13 +547,12 @@ namespace ImGui
 | 
			
		||||
    IMGUI_API const char*   GetClipboardText();
 | 
			
		||||
    IMGUI_API void          SetClipboardText(const char* text);
 | 
			
		||||
 | 
			
		||||
    // (Optional) Platform/OS interface for multi-viewport support
 | 
			
		||||
    IMGUI_API ImGuiPlatformIO&  GetPlatformIO();                                                // platform/renderer functions, for back-end to setup + viewports list.
 | 
			
		||||
    IMGUI_API ImGuiViewport*    GetMainViewport();                                              // shortcut to == GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0]
 | 
			
		||||
    IMGUI_API void              UpdatePlatformWindows();                                        // call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
 | 
			
		||||
    IMGUI_API void              RenderPlatformWindowsDefault(void* platform_arg = NULL, void* renderer_arg = NULL); // call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport. may be reimplemented by user for custom rendering needs.
 | 
			
		||||
    IMGUI_API void              DestroyPlatformWindows();                                       // call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
 | 
			
		||||
    IMGUI_API ImGuiViewport*    FindViewportByPlatformHandle(void* platform_handle);            // this is a helper for back-ends. the type platform_handle is decided by the back-end (e.g. HWND, MyWindow*, GLFWwindow* etc.)
 | 
			
		||||
    // Settings/.Ini Utilities
 | 
			
		||||
    // The disk functions are automatically called if io.IniFilename != NULL (default is "imgui.ini"). Set io.IniFilename to NULL to load/save manually.
 | 
			
		||||
    IMGUI_API void          LoadIniSettingsFromDisk(const char* ini_filename);                  // call after CreateContext() and before the first call to NewFrame(). NewFrame() automatically calls LoadIniSettingsFromDisk(io.IniFilename).
 | 
			
		||||
    IMGUI_API void          LoadIniSettingsFromMemory(const char* ini_data, size_t ini_size=0); // call after CreateContext() and before the first call to NewFrame() to provide .ini data from your own data source.
 | 
			
		||||
    IMGUI_API void          SaveIniSettingsToDisk(const char* ini_filename);
 | 
			
		||||
    IMGUI_API const char*   SaveIniSettingsToMemory(size_t* out_ini_size = NULL);               // return a zero-terminated string with the .ini data which you can save by your own mean.
 | 
			
		||||
 | 
			
		||||
    // Memory Utilities
 | 
			
		||||
    // All those functions are not reliant on the current context.
 | 
			
		||||
@@ -561,6 +561,14 @@ namespace ImGui
 | 
			
		||||
    IMGUI_API void*         MemAlloc(size_t size);
 | 
			
		||||
    IMGUI_API void          MemFree(void* ptr);
 | 
			
		||||
 | 
			
		||||
    // (Optional) Platform/OS interface for multi-viewport support
 | 
			
		||||
    IMGUI_API ImGuiPlatformIO&  GetPlatformIO();                                                // platform/renderer functions, for back-end to setup + viewports list.
 | 
			
		||||
    IMGUI_API ImGuiViewport*    GetMainViewport();                                              // shortcut to == GetPlatformIO().MainViewport == GetPlatformIO().Viewports[0]
 | 
			
		||||
    IMGUI_API void              UpdatePlatformWindows();                                        // call in main loop. will call CreateWindow/ResizeWindow/etc. platform functions for each secondary viewport, and DestroyWindow for each inactive viewport.
 | 
			
		||||
    IMGUI_API void              RenderPlatformWindowsDefault(void* platform_arg = NULL, void* renderer_arg = NULL); // call in main loop. will call RenderWindow/SwapBuffers platform functions for each secondary viewport. may be reimplemented by user for custom rendering needs.
 | 
			
		||||
    IMGUI_API void              DestroyPlatformWindows();                                       // call DestroyWindow platform functions for all viewports. call from back-end Shutdown() if you need to close platform windows before imgui shutdown. otherwise will be called by DestroyContext().
 | 
			
		||||
    IMGUI_API ImGuiViewport*    FindViewportByPlatformHandle(void* platform_handle);            // this is a helper for back-ends. the type platform_handle is decided by the back-end (e.g. HWND, MyWindow*, GLFWwindow* etc.)
 | 
			
		||||
 | 
			
		||||
} // namespace ImGui
 | 
			
		||||
 | 
			
		||||
// Flags for ImGui::Begin()
 | 
			
		||||
@@ -708,7 +716,7 @@ enum ImGuiDragDropFlags_
 | 
			
		||||
    ImGuiDragDropFlags_AcceptPeekOnly               = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect  // For peeking ahead and inspecting the payload before delivery.
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// Standard Drag and Drop payload types. You can define you own payload types using 12-characters long strings. Types starting with '_' are defined by Dear ImGui.
 | 
			
		||||
// Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui.
 | 
			
		||||
#define IMGUI_PAYLOAD_TYPE_COLOR_3F     "_COL3F"    // float[3]: Standard type for colors, without alpha. User code may use this type. 
 | 
			
		||||
#define IMGUI_PAYLOAD_TYPE_COLOR_4F     "_COL4F"    // float[4]: Standard type for colors. User code may use this type.
 | 
			
		||||
 | 
			
		||||
@@ -861,10 +869,10 @@ enum ImGuiCol_
 | 
			
		||||
    ImGuiCol_PlotHistogram,
 | 
			
		||||
    ImGuiCol_PlotHistogramHovered,
 | 
			
		||||
    ImGuiCol_TextSelectedBg,
 | 
			
		||||
    ImGuiCol_ModalWindowDarkening,  // darken/colorize entire screen behind a modal window, when one is active
 | 
			
		||||
    ImGuiCol_ModalWindowDarkening,  // Darken/colorize entire screen behind a modal window, when one is active
 | 
			
		||||
    ImGuiCol_DragDropTarget,
 | 
			
		||||
    ImGuiCol_NavHighlight,          // gamepad/keyboard: current highlighted item 
 | 
			
		||||
    ImGuiCol_NavWindowingHighlight, // gamepad/keyboard: when holding NavMenu to focus/move/resize windows
 | 
			
		||||
    ImGuiCol_NavHighlight,          // Gamepad/keyboard: current highlighted item 
 | 
			
		||||
    ImGuiCol_NavWindowingHighlight, // Gamepad/keyboard: when holding NavMenu to focus/move/resize windows
 | 
			
		||||
    ImGuiCol_COUNT
 | 
			
		||||
 | 
			
		||||
    // Obsolete names (will be removed)
 | 
			
		||||
@@ -1025,11 +1033,11 @@ struct ImGuiIO
 | 
			
		||||
    //------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
    ImGuiConfigFlags   ConfigFlags;         // = 0                  // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc.
 | 
			
		||||
    ImGuiBackendFlags  BackendFlags;        // = 0                  // Set ImGuiBackendFlags_ enum. Set by imgui_impl_xxx files or custom back-end.
 | 
			
		||||
    ImGuiBackendFlags  BackendFlags;        // = 0                  // Set ImGuiBackendFlags_ enum. Set by imgui_impl_xxx files or custom back-end to communicate features supported by the back-end.
 | 
			
		||||
    ImVec2        DisplaySize;              // <unset>              // Main display size. Used e.g. to clamp windows positions. This is the default viewport. Use BeginViewport() for other viewports.
 | 
			
		||||
    float         DeltaTime;                // = 1.0f/60.0f         // Time elapsed since last frame, in seconds.
 | 
			
		||||
    float         IniSavingRate;            // = 5.0f               // Maximum time between saving positions/sizes to .ini file, in seconds.
 | 
			
		||||
    const char*   IniFilename;              // = "imgui.ini"        // Path to .ini file. NULL to disable .ini saving.
 | 
			
		||||
    float         IniSavingRate;            // = 5.0f               // Minimum time between saving positions/sizes to .ini file, in seconds.
 | 
			
		||||
    const char*   IniFilename;              // = "imgui.ini"        // Path to .ini file. Set NULL to disable automatic .ini loading/saving, if e.g. you want to manually load/save from memory.
 | 
			
		||||
    const char*   LogFilename;              // = "imgui_log.txt"    // Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
 | 
			
		||||
    float         MouseDoubleClickTime;     // = 0.30f              // Time for a double-click, in seconds.
 | 
			
		||||
    float         MouseDoubleClickMaxDist;  // = 6.0f               // Distance threshold to stay in to validate a double-click, in pixels.
 | 
			
		||||
@@ -1060,9 +1068,12 @@ struct ImGuiIO
 | 
			
		||||
    void*       ClipboardUserData;
 | 
			
		||||
 | 
			
		||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
 | 
			
		||||
    // [OBSOLETE] Rendering function, will be automatically called in Render(). Please call your rendering function yourself now! You can obtain the ImDrawData* by calling ImGui::GetDrawData() after Render().
 | 
			
		||||
    // See example applications if you are unsure of how to implement this.
 | 
			
		||||
    // [OBSOLETE] Rendering function, will be automatically called in Render(). Please call your rendering function yourself now! 
 | 
			
		||||
    // You can obtain the ImDrawData* by calling ImGui::GetDrawData() after Render(). See example applications if you are unsure of how to implement this.
 | 
			
		||||
    void        (*RenderDrawListsFn)(ImDrawData* data);
 | 
			
		||||
#else
 | 
			
		||||
    // This is only here to keep ImGuiIO the same size, so that IMGUI_DISABLE_OBSOLETE_FUNCTIONS can exceptionally be used outside of imconfig.h.
 | 
			
		||||
    void*       RenderDrawListsFnDummy;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    //------------------------------------------------------------------
 | 
			
		||||
@@ -1097,6 +1108,7 @@ struct ImGuiIO
 | 
			
		||||
    bool        WantCaptureKeyboard;        // When io.WantCaptureKeyboard is true, imgui will use the keyboard inputs, do not dispatch them to your main game/application (in both cases, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
 | 
			
		||||
    bool        WantTextInput;              // Mobile/console: when io.WantTextInput is true, you may display an on-screen keyboard. This is set by ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
 | 
			
		||||
    bool        WantSetMousePos;            // MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
 | 
			
		||||
    bool        WantSaveIniSettings;        // If io.IniFilename == NULL, this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. IMPORTANT: You need to clear io.WantSaveIniSettings yourself.
 | 
			
		||||
    bool        NavActive;                  // Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
 | 
			
		||||
    bool        NavVisible;                 // Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
 | 
			
		||||
    float       Framerate;                  // Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames
 | 
			
		||||
@@ -1135,6 +1147,11 @@ struct ImGuiIO
 | 
			
		||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
 | 
			
		||||
namespace ImGui
 | 
			
		||||
{
 | 
			
		||||
    // OBSOLETED in 1.61 (from Apr 2018)
 | 
			
		||||
    bool                InputFloat(const char* label, float* v, float step, float step_fast, int decimal_precision, ImGuiInputTextFlags extra_flags = 0); // Use the 'const char* format' version instead of 'decimal_precision'!
 | 
			
		||||
    bool                InputFloat2(const char* label, float v[2], int decimal_precision, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    bool                InputFloat3(const char* label, float v[3], int decimal_precision, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    bool                InputFloat4(const char* label, float v[4], int decimal_precision, ImGuiInputTextFlags extra_flags = 0);
 | 
			
		||||
    // OBSOLETED in 1.60 (from Dec 2017)
 | 
			
		||||
    static inline bool  IsAnyWindowFocused()                  { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); }
 | 
			
		||||
    static inline bool  IsAnyWindowHovered()                  { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
 | 
			
		||||
@@ -1388,7 +1405,7 @@ struct ImGuiSizeCallbackData
 | 
			
		||||
struct ImGuiPayload
 | 
			
		||||
{
 | 
			
		||||
    // Members
 | 
			
		||||
    const void*     Data;               // Data (copied and owned by dear imgui)
 | 
			
		||||
    void*           Data;               // Data (copied and owned by dear imgui)
 | 
			
		||||
    int             DataSize;           // Data size
 | 
			
		||||
 | 
			
		||||
    // [Internal]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user