|
@@ -1,4 +1,4 @@
|
|
|
-// dear imgui, v1.53
|
|
|
|
|
|
|
+// dear imgui, v1.60 WIP
|
|
|
// (headers)
|
|
// (headers)
|
|
|
|
|
|
|
|
// See imgui.cpp file for documentation.
|
|
// See imgui.cpp file for documentation.
|
|
@@ -8,15 +8,20 @@
|
|
|
|
|
|
|
|
#pragma once
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
+// User-editable configuration files (edit stock imconfig.h or define IMGUI_USER_CONFIG to your own filename)
|
|
|
|
|
+#ifdef IMGUI_USER_CONFIG
|
|
|
|
|
+#include IMGUI_USER_CONFIG
|
|
|
|
|
+#endif
|
|
|
#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
|
|
#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
|
|
|
-#include "imconfig.h" // User-editable configuration file
|
|
|
|
|
|
|
+#include "imconfig.h"
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+
|
|
|
#include <float.h> // FLT_MAX
|
|
#include <float.h> // FLT_MAX
|
|
|
#include <stdarg.h> // va_list
|
|
#include <stdarg.h> // va_list
|
|
|
#include <stddef.h> // ptrdiff_t, NULL
|
|
#include <stddef.h> // ptrdiff_t, NULL
|
|
|
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
|
|
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
|
|
|
|
|
|
|
|
-#define IMGUI_VERSION "1.53"
|
|
|
|
|
|
|
+#define IMGUI_VERSION "1.60 WIP"
|
|
|
|
|
|
|
|
// 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
|
|
#ifndef IMGUI_API
|
|
@@ -39,6 +44,7 @@
|
|
|
#define IM_FMTLIST(FMT)
|
|
#define IM_FMTLIST(FMT)
|
|
|
#endif
|
|
#endif
|
|
|
#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
|
|
#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR)/sizeof(*_ARR)))
|
|
|
|
|
+#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in modern C++.
|
|
|
|
|
|
|
|
#if defined(__clang__)
|
|
#if defined(__clang__)
|
|
|
#pragma clang diagnostic push
|
|
#pragma clang diagnostic push
|
|
@@ -63,7 +69,7 @@ struct ImGuiStyle; // Runtime data for styling/colors
|
|
|
struct ImGuiTextFilter; // Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
|
|
struct ImGuiTextFilter; // Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
|
|
|
struct ImGuiTextBuffer; // Text buffer for logging/accumulating text
|
|
struct ImGuiTextBuffer; // Text buffer for logging/accumulating text
|
|
|
struct ImGuiTextEditCallbackData; // Shared state of ImGui::InputText() when using custom ImGuiTextEditCallback (rare/advanced use)
|
|
struct ImGuiTextEditCallbackData; // Shared state of ImGui::InputText() when using custom ImGuiTextEditCallback (rare/advanced use)
|
|
|
-struct ImGuiSizeConstraintCallbackData;// Structure used to constraint window size in custom ways when using custom ImGuiSizeConstraintCallback (rare/advanced use)
|
|
|
|
|
|
|
+struct ImGuiSizeCallbackData; // Structure used to constraint window size in custom ways when using custom ImGuiSizeCallback (rare/advanced use)
|
|
|
struct ImGuiListClipper; // Helper to manually clip large list of items
|
|
struct ImGuiListClipper; // Helper to manually clip large list of items
|
|
|
struct ImGuiPayload; // User data payload for drag and drop operations
|
|
struct ImGuiPayload; // User data payload for drag and drop operations
|
|
|
struct ImGuiContext; // ImGui context (opaque)
|
|
struct ImGuiContext; // ImGui context (opaque)
|
|
@@ -76,10 +82,12 @@ typedef void* ImTextureID; // user data to identify a texture (this is
|
|
|
typedef int ImGuiCol; // enum: a color identifier for styling // enum ImGuiCol_
|
|
typedef int ImGuiCol; // enum: a color identifier for styling // enum ImGuiCol_
|
|
|
typedef int ImGuiCond; // enum: a condition for Set*() // enum ImGuiCond_
|
|
typedef int ImGuiCond; // enum: a condition for Set*() // enum ImGuiCond_
|
|
|
typedef int ImGuiKey; // enum: a key identifier (ImGui-side enum) // enum ImGuiKey_
|
|
typedef int ImGuiKey; // enum: a key identifier (ImGui-side enum) // enum ImGuiKey_
|
|
|
|
|
+typedef int ImGuiNavInput; // enum: an input identifier for navigation // enum ImGuiNavInput_
|
|
|
typedef int ImGuiMouseCursor; // enum: a mouse cursor identifier // enum ImGuiMouseCursor_
|
|
typedef int ImGuiMouseCursor; // enum: a mouse cursor identifier // enum ImGuiMouseCursor_
|
|
|
typedef int ImGuiStyleVar; // enum: a variable identifier for styling // enum ImGuiStyleVar_
|
|
typedef int ImGuiStyleVar; // enum: a variable identifier for styling // enum ImGuiStyleVar_
|
|
|
typedef int ImDrawCornerFlags; // flags: for ImDrawList::AddRect*() etc. // enum ImDrawCornerFlags_
|
|
typedef int ImDrawCornerFlags; // flags: for ImDrawList::AddRect*() etc. // enum ImDrawCornerFlags_
|
|
|
typedef int ImDrawListFlags; // flags: for ImDrawList // enum ImDrawListFlags_
|
|
typedef int ImDrawListFlags; // flags: for ImDrawList // enum ImDrawListFlags_
|
|
|
|
|
+typedef int ImFontAtlasFlags; // flags: for ImFontAtlas // enum ImFontAtlasFlags_
|
|
|
typedef int ImGuiColorEditFlags; // flags: for ColorEdit*(), ColorPicker*() // enum ImGuiColorEditFlags_
|
|
typedef int ImGuiColorEditFlags; // flags: for ColorEdit*(), ColorPicker*() // enum ImGuiColorEditFlags_
|
|
|
typedef int ImGuiColumnsFlags; // flags: for *Columns*() // enum ImGuiColumnsFlags_
|
|
typedef int ImGuiColumnsFlags; // flags: for *Columns*() // enum ImGuiColumnsFlags_
|
|
|
typedef int ImGuiDragDropFlags; // flags: for *DragDrop*() // enum ImGuiDragDropFlags_
|
|
typedef int ImGuiDragDropFlags; // flags: for *DragDrop*() // enum ImGuiDragDropFlags_
|
|
@@ -87,11 +95,12 @@ typedef int ImGuiComboFlags; // flags: for BeginCombo()
|
|
|
typedef int ImGuiFocusedFlags; // flags: for IsWindowFocused() // enum ImGuiFocusedFlags_
|
|
typedef int ImGuiFocusedFlags; // flags: for IsWindowFocused() // enum ImGuiFocusedFlags_
|
|
|
typedef int ImGuiHoveredFlags; // flags: for IsItemHovered() etc. // enum ImGuiHoveredFlags_
|
|
typedef int ImGuiHoveredFlags; // flags: for IsItemHovered() etc. // enum ImGuiHoveredFlags_
|
|
|
typedef int ImGuiInputTextFlags; // flags: for InputText*() // enum ImGuiInputTextFlags_
|
|
typedef int ImGuiInputTextFlags; // flags: for InputText*() // enum ImGuiInputTextFlags_
|
|
|
|
|
+typedef int ImGuiNavFlags; // flags: for io.NavFlags // enum ImGuiNavFlags_
|
|
|
typedef int ImGuiSelectableFlags; // flags: for Selectable() // enum ImGuiSelectableFlags_
|
|
typedef int ImGuiSelectableFlags; // flags: for Selectable() // enum ImGuiSelectableFlags_
|
|
|
typedef int ImGuiTreeNodeFlags; // flags: for TreeNode*(),CollapsingHeader()// enum ImGuiTreeNodeFlags_
|
|
typedef int ImGuiTreeNodeFlags; // flags: for TreeNode*(),CollapsingHeader()// enum ImGuiTreeNodeFlags_
|
|
|
typedef int ImGuiWindowFlags; // flags: for Begin*() // enum ImGuiWindowFlags_
|
|
typedef int ImGuiWindowFlags; // flags: for Begin*() // enum ImGuiWindowFlags_
|
|
|
typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
|
|
typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data);
|
|
|
-typedef void (*ImGuiSizeConstraintCallback)(ImGuiSizeConstraintCallbackData* data);
|
|
|
|
|
|
|
+typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data);
|
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
#if defined(_MSC_VER) && !defined(__clang__)
|
|
|
typedef unsigned __int64 ImU64; // 64-bit unsigned integer
|
|
typedef unsigned __int64 ImU64; // 64-bit unsigned integer
|
|
|
#else
|
|
#else
|
|
@@ -107,6 +116,7 @@ struct ImVec2
|
|
|
float x, y;
|
|
float x, y;
|
|
|
ImVec2() { x = y = 0.0f; }
|
|
ImVec2() { x = y = 0.0f; }
|
|
|
ImVec2(float _x, float _y) { x = _x; y = _y; }
|
|
ImVec2(float _x, float _y) { x = _x; y = _y; }
|
|
|
|
|
+ float operator[] (size_t idx) const { IM_ASSERT(idx == 0 || idx == 1); return (&x)[idx]; } // We very rarely use this [] operator, thus an assert 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.
|
|
#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
|
|
IM_VEC2_CLASS_EXTRA
|
|
|
#endif
|
|
#endif
|
|
@@ -126,14 +136,21 @@ struct ImVec4
|
|
|
// 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 a separate file (e.g. Value() helpers for your vector or common types)
|
|
|
namespace ImGui
|
|
namespace ImGui
|
|
|
{
|
|
{
|
|
|
|
|
+ // Context creation and access, if you want to use multiple context, share context between modules (e.g. DLL).
|
|
|
|
|
+ // All contexts share a same ImFontAtlas by default. If you want different font atlas, you can new() them and overwrite the GetIO().Fonts variable of an ImGui context.
|
|
|
|
|
+ // All those functions are not reliant on the current context.
|
|
|
|
|
+ IMGUI_API ImGuiContext* CreateContext(ImFontAtlas* shared_font_atlas = NULL);
|
|
|
|
|
+ IMGUI_API void DestroyContext(ImGuiContext* ctx = NULL); // NULL = Destroy current context
|
|
|
|
|
+ IMGUI_API ImGuiContext* GetCurrentContext();
|
|
|
|
|
+ IMGUI_API void SetCurrentContext(ImGuiContext* ctx);
|
|
|
|
|
+
|
|
|
// Main
|
|
// Main
|
|
|
IMGUI_API ImGuiIO& GetIO();
|
|
IMGUI_API ImGuiIO& GetIO();
|
|
|
IMGUI_API ImGuiStyle& GetStyle();
|
|
IMGUI_API ImGuiStyle& GetStyle();
|
|
|
- IMGUI_API ImDrawData* GetDrawData(); // same value as passed to your io.RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame()
|
|
|
|
|
IMGUI_API void NewFrame(); // start a new ImGui frame, you can submit any command from this point until Render()/EndFrame().
|
|
IMGUI_API void NewFrame(); // start a new ImGui frame, you can submit any command from this point until Render()/EndFrame().
|
|
|
- IMGUI_API void Render(); // ends the ImGui frame, finalize the draw data, then call your io.RenderDrawListsFn() function if set.
|
|
|
|
|
|
|
+ IMGUI_API void Render(); // ends the ImGui frame, finalize the draw data. (Obsolete: optionally call io.RenderDrawListsFn if set. Nowadays, prefer calling your render function yourself.)
|
|
|
|
|
+ IMGUI_API ImDrawData* GetDrawData(); // valid after Render() and until the next call to NewFrame(). this is what you have to render. (Obsolete: this used to be passed to your io.RenderDrawListsFn() function.)
|
|
|
IMGUI_API void EndFrame(); // ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead!
|
|
IMGUI_API void EndFrame(); // ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead!
|
|
|
- IMGUI_API void Shutdown();
|
|
|
|
|
|
|
|
|
|
// Demo, Debug, Informations
|
|
// Demo, Debug, Informations
|
|
|
IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create demo/test window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
|
|
IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create demo/test window (previously called ShowTestWindow). demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
|
|
@@ -142,13 +159,19 @@ namespace ImGui
|
|
|
IMGUI_API bool ShowStyleSelector(const char* label);
|
|
IMGUI_API bool ShowStyleSelector(const char* label);
|
|
|
IMGUI_API void ShowFontSelector(const char* label);
|
|
IMGUI_API void ShowFontSelector(const char* label);
|
|
|
IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
|
|
IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
|
|
|
|
|
+ IMGUI_API const char* GetVersion();
|
|
|
|
|
+
|
|
|
|
|
+ // Styles
|
|
|
|
|
+ IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL); // New, recommended style
|
|
|
|
|
+ IMGUI_API void StyleColorsClassic(ImGuiStyle* dst = NULL); // Classic imgui style (default)
|
|
|
|
|
+ IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL); // Best used with borders and a custom, thicker font
|
|
|
|
|
|
|
|
// Window
|
|
// Window
|
|
|
- IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // push window to the stack and start appending to it. see .cpp for details. return false when window is collapsed, so you can early out in your code. 'bool* p_open' creates a widget on the upper-right to close the window (which sets your bool to false).
|
|
|
|
|
- IMGUI_API void End(); // finish appending to current window, pop it off the window stack.
|
|
|
|
|
- IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
|
|
|
|
|
- IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags extra_flags = 0); // "
|
|
|
|
|
- IMGUI_API void EndChild();
|
|
|
|
|
|
|
+ IMGUI_API bool Begin(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // push window to the stack and start appending to it. see .cpp for details. return false when window is collapsed (so you can early out in your code) but you always need to call End() regardless. 'bool* p_open' creates a widget on the upper-right to close the window (which sets your bool to false).
|
|
|
|
|
+ IMGUI_API void End(); // always call even if Begin() return false (which indicates a collapsed window)! finish appending to current window, pop it off the window stack.
|
|
|
|
|
+ IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); // begin a scrolling region. size==0.0f: use remaining window size, size<0.0f: use remaining window size minus abs(size). size>0.0f: fixed size. each axis can use a different mode, e.g. ImVec2(0,400).
|
|
|
|
|
+ IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0,0), bool border = false, ImGuiWindowFlags flags = 0); // "
|
|
|
|
|
+ IMGUI_API void EndChild(); // always call even if BeginChild() return false (which indicates a collapsed or clipping child window)
|
|
|
IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
|
|
IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
|
|
|
IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
|
|
IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
|
|
|
IMGUI_API float GetContentRegionAvailWidth(); //
|
|
IMGUI_API float GetContentRegionAvailWidth(); //
|
|
@@ -166,10 +189,11 @@ namespace ImGui
|
|
|
|
|
|
|
|
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0,0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
|
|
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0,0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
|
|
|
IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
|
|
IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
|
|
|
- IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeConstraintCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints.
|
|
|
|
|
|
|
+ IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints.
|
|
|
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin()
|
|
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin()
|
|
|
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin()
|
|
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin()
|
|
|
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
|
|
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
|
|
|
|
|
+ IMGUI_API void SetNextWindowBgAlpha(float alpha); // set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg.
|
|
|
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
|
|
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
|
|
|
IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
|
|
IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
|
|
|
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
|
|
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
|
|
@@ -302,13 +326,14 @@ namespace ImGui
|
|
|
// The new BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it.
|
|
// The new BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it.
|
|
|
// The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose.
|
|
// The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose.
|
|
|
IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0);
|
|
IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0);
|
|
|
- IMGUI_API void EndCombo();
|
|
|
|
|
|
|
+ IMGUI_API void EndCombo(); // only call EndCombo() if BeginCombo() returns true!
|
|
|
IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
|
|
IMGUI_API bool Combo(const char* label, int* current_item, const char* const items[], int items_count, int popup_max_height_in_items = -1);
|
|
|
IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"
|
|
IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int popup_max_height_in_items = -1); // Separate items with \0 within a string, end item-list with \0\0. e.g. "One\0Two\0Three\0"
|
|
|
IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1);
|
|
IMGUI_API bool Combo(const char* label, int* current_item, bool(*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int popup_max_height_in_items = -1);
|
|
|
|
|
|
|
|
// Widgets: Drags (tip: ctrl+click on a drag box to input with keyboard. manually input values aren't clamped, can go off-bounds)
|
|
// 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
|
|
// 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 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 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 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);
|
|
@@ -375,9 +400,9 @@ namespace ImGui
|
|
|
IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header
|
|
IMGUI_API bool CollapsingHeader(const char* label, bool* p_open, ImGuiTreeNodeFlags flags = 0); // when 'p_open' isn't NULL, display an additional small close button on upper right of the header
|
|
|
|
|
|
|
|
// Widgets: Selectable / Lists
|
|
// Widgets: Selectable / Lists
|
|
|
- IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
|
|
|
|
|
- IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0));
|
|
|
|
|
- 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 Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
|
|
|
|
|
+ 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 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. make sure to call ListBoxFooter() afterwards.
|
|
|
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
|
|
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
|
|
@@ -396,24 +421,24 @@ namespace ImGui
|
|
|
IMGUI_API void EndTooltip();
|
|
IMGUI_API void EndTooltip();
|
|
|
|
|
|
|
|
// Menus
|
|
// Menus
|
|
|
- IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar. only call EndMainMenuBar() if this returns true!
|
|
|
|
|
- IMGUI_API void EndMainMenuBar();
|
|
|
|
|
- IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window). only call EndMenuBar() if this returns true!
|
|
|
|
|
- IMGUI_API void EndMenuBar();
|
|
|
|
|
|
|
+ IMGUI_API bool BeginMainMenuBar(); // create and append to a full screen menu-bar.
|
|
|
|
|
+ IMGUI_API void EndMainMenuBar(); // only call EndMainMenuBar() if BeginMainMenuBar() returns true!
|
|
|
|
|
+ IMGUI_API bool BeginMenuBar(); // append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set on parent window).
|
|
|
|
|
+ IMGUI_API void EndMenuBar(); // only call EndMenuBar() if BeginMenuBar() returns true!
|
|
|
IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true!
|
|
IMGUI_API bool BeginMenu(const char* label, bool enabled = true); // create a sub-menu entry. only call EndMenu() if this returns true!
|
|
|
- IMGUI_API void EndMenu();
|
|
|
|
|
|
|
+ IMGUI_API void EndMenu(); // only call EndBegin() if BeginMenu() returns true!
|
|
|
IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment
|
|
IMGUI_API bool MenuItem(const char* label, const char* shortcut = NULL, bool selected = false, bool enabled = true); // return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment
|
|
|
IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL
|
|
IMGUI_API bool MenuItem(const char* label, const char* shortcut, bool* p_selected, bool enabled = true); // return true when activated + toggle (*p_selected) if p_selected != NULL
|
|
|
|
|
|
|
|
// Popups
|
|
// Popups
|
|
|
IMGUI_API void OpenPopup(const char* str_id); // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
|
|
IMGUI_API void OpenPopup(const char* str_id); // call to mark popup as open (don't call every frame!). popups are closed when user click outside, or if CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. By default, Selectable()/MenuItem() are calling CloseCurrentPopup(). Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level).
|
|
|
- IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, int mouse_button = 1); // helper to open popup when clicked on last item. return true when just opened.
|
|
|
|
|
- IMGUI_API bool BeginPopup(const char* str_id); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returned true!
|
|
|
|
|
- IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags extra_flags = 0); // modal dialog (block interactions behind the modal window, can't close the modal window by clicking outside)
|
|
|
|
|
|
|
+ IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it. only call EndPopup() if BeginPopup() returns true!
|
|
|
IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!
|
|
IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked on last item. if you can pass a NULL str_id only if the previous item had an id. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!
|
|
|
IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true); // helper to open and begin popup when clicked on current window.
|
|
IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, int mouse_button = 1, bool also_over_items = true); // helper to open and begin popup when clicked on current window.
|
|
|
IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked in void (where there are no imgui windows).
|
|
IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, int mouse_button = 1); // helper to open and begin popup when clicked in void (where there are no imgui windows).
|
|
|
- IMGUI_API void EndPopup();
|
|
|
|
|
|
|
+ IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // modal dialog (regular window with title bar, block interactions behind the modal window, can't close the modal window by clicking outside)
|
|
|
|
|
+ IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true!
|
|
|
|
|
+ IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, int mouse_button = 1); // helper to open popup when clicked on last item. return true when just opened.
|
|
|
IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open
|
|
IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open
|
|
|
IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
|
|
IMGUI_API void CloseCurrentPopup(); // close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
|
|
|
|
|
|
|
@@ -427,43 +452,37 @@ namespace ImGui
|
|
|
|
|
|
|
|
// Drag and Drop
|
|
// Drag and Drop
|
|
|
// [BETA API] Missing Demo code. API may evolve.
|
|
// [BETA API] Missing Demo code. API may evolve.
|
|
|
- IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0, int mouse_button = 0); // call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource()
|
|
|
|
|
- IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t size, ImGuiCond cond = 0);// type is a user defined string of maximum 8 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui.
|
|
|
|
|
- IMGUI_API void EndDragDropSource();
|
|
|
|
|
|
|
+ IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0); // call when the current item is active. If this return true, you can call SetDragDropPayload() + EndDragDropSource()
|
|
|
|
|
+ IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t size, ImGuiCond cond = 0);// type is a user defined string of maximum 12 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui.
|
|
|
|
|
+ IMGUI_API void EndDragDropSource(); // only call EndDragDropSource() if BeginDragDropSource() returns true!
|
|
|
IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
|
|
IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive an item. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
|
|
|
IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
|
|
IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
|
|
|
- IMGUI_API void EndDragDropTarget();
|
|
|
|
|
|
|
+ IMGUI_API void EndDragDropTarget(); // only call EndDragDropTarget() if BeginDragDropTarget() returns true!
|
|
|
|
|
|
|
|
// Clipping
|
|
// Clipping
|
|
|
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect);
|
|
IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect);
|
|
|
IMGUI_API void PopClipRect();
|
|
IMGUI_API void PopClipRect();
|
|
|
|
|
|
|
|
- // Styles
|
|
|
|
|
- IMGUI_API void StyleColorsClassic(ImGuiStyle* dst = NULL);
|
|
|
|
|
- IMGUI_API void StyleColorsDark(ImGuiStyle* dst = NULL);
|
|
|
|
|
- IMGUI_API void StyleColorsLight(ImGuiStyle* dst = NULL);
|
|
|
|
|
-
|
|
|
|
|
- // Focus
|
|
|
|
|
- // (FIXME: Those functions will be reworked after we merge the navigation branch + have a pass at focusing/tabbing features.)
|
|
|
|
|
|
|
+ // Focus, Activation
|
|
|
// (Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHere()" when applicable, to make your code more forward compatible when navigation branch is merged)
|
|
// (Prefer using "SetItemDefaultFocus()" over "if (IsWindowAppearing()) SetScrollHere()" when applicable, to make your code more forward compatible when navigation branch is merged)
|
|
|
- IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window (WIP navigation branch only). Pleaase use instead of SetScrollHere().
|
|
|
|
|
|
|
+ IMGUI_API void SetItemDefaultFocus(); // make last item the default focused item of a window. Please use instead of "if (IsWindowAppearing()) SetScrollHere()" to signify "default item".
|
|
|
IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
|
|
IMGUI_API void SetKeyboardFocusHere(int offset = 0); // focus keyboard on the next widget. Use positive 'offset' to access sub components of a multiple component widget. Use -1 to access previous widget.
|
|
|
|
|
|
|
|
// Utilities
|
|
// Utilities
|
|
|
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
|
|
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
|
|
|
IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
|
IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
|
|
|
|
+ IMGUI_API bool IsItemFocused(); // is the last item focused for keyboard/gamepad navigation?
|
|
|
IMGUI_API bool IsItemClicked(int mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on)
|
|
IMGUI_API bool IsItemClicked(int mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on)
|
|
|
IMGUI_API bool IsItemVisible(); // is the last item visible? (aka not out of sight due to clipping/scrolling.)
|
|
IMGUI_API bool IsItemVisible(); // is the last item visible? (aka not out of sight due to clipping/scrolling.)
|
|
|
IMGUI_API bool IsAnyItemHovered();
|
|
IMGUI_API bool IsAnyItemHovered();
|
|
|
IMGUI_API bool IsAnyItemActive();
|
|
IMGUI_API bool IsAnyItemActive();
|
|
|
|
|
+ IMGUI_API bool IsAnyItemFocused();
|
|
|
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rectangle of last item, in screen space
|
|
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rectangle of last item, in screen space
|
|
|
IMGUI_API ImVec2 GetItemRectMax(); // "
|
|
IMGUI_API ImVec2 GetItemRectMax(); // "
|
|
|
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item, in screen space
|
|
IMGUI_API ImVec2 GetItemRectSize(); // get size of last item, in screen space
|
|
|
IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
|
|
IMGUI_API void SetItemAllowOverlap(); // allow last item to be overlapped by a subsequent item. sometimes useful with invisible buttons, selectables, etc. to catch unused area.
|
|
|
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags = 0); // is current window focused? or its root/child, depending on flags. see flags for options.
|
|
IMGUI_API bool IsWindowFocused(ImGuiFocusedFlags flags = 0); // is current window focused? or its root/child, depending on flags. see flags for options.
|
|
|
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags = 0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options.
|
|
IMGUI_API bool IsWindowHovered(ImGuiHoveredFlags flags = 0); // is current window hovered (and typically: not blocked by a popup/modal)? see flags for options.
|
|
|
- IMGUI_API bool IsAnyWindowFocused();
|
|
|
|
|
- IMGUI_API bool IsAnyWindowHovered(); // is mouse hovering any visible window
|
|
|
|
|
IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped.
|
|
IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped.
|
|
|
IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
|
|
IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
|
|
|
IMGUI_API float GetTime();
|
|
IMGUI_API float GetTime();
|
|
@@ -471,12 +490,11 @@ namespace ImGui
|
|
|
IMGUI_API ImDrawList* GetOverlayDrawList(); // this draw list will be the last rendered one, useful to quickly draw overlays shapes/text
|
|
IMGUI_API ImDrawList* GetOverlayDrawList(); // this draw list will be the last rendered one, useful to quickly draw overlays shapes/text
|
|
|
IMGUI_API ImDrawListSharedData* GetDrawListSharedData();
|
|
IMGUI_API ImDrawListSharedData* GetDrawListSharedData();
|
|
|
IMGUI_API const char* GetStyleColorName(ImGuiCol idx);
|
|
IMGUI_API const char* GetStyleColorName(ImGuiCol idx);
|
|
|
- IMGUI_API ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = +0.0f); // utility to find the closest point the last item bounding rectangle edge. useful to visually link items
|
|
|
|
|
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
|
|
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
|
|
|
IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.
|
|
IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.
|
|
|
|
|
|
|
|
- IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags extra_flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame
|
|
|
|
|
- IMGUI_API void EndChildFrame();
|
|
|
|
|
|
|
+ IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame
|
|
|
|
|
+ IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)
|
|
|
|
|
|
|
|
IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in);
|
|
IMGUI_API ImVec4 ColorConvertU32ToFloat4(ImU32 in);
|
|
|
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in);
|
|
IMGUI_API ImU32 ColorConvertFloat4ToU32(const ImVec4& in);
|
|
@@ -490,6 +508,7 @@ namespace ImGui
|
|
|
IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)..
|
|
IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)..
|
|
|
IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
|
|
IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
|
|
|
IMGUI_API bool IsMouseDown(int button); // is mouse button held
|
|
IMGUI_API bool IsMouseDown(int button); // is mouse button held
|
|
|
|
|
+ IMGUI_API bool IsAnyMouseDown(); // is any mouse button held
|
|
|
IMGUI_API bool IsMouseClicked(int button, bool repeat = false); // did mouse button clicked (went from !Down to Down)
|
|
IMGUI_API bool IsMouseClicked(int button, bool repeat = false); // did mouse button clicked (went from !Down to Down)
|
|
|
IMGUI_API bool IsMouseDoubleClicked(int button); // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
|
|
IMGUI_API bool IsMouseDoubleClicked(int button); // did mouse button double-clicked. a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
|
|
|
IMGUI_API bool IsMouseReleased(int button); // did mouse button released (went from Down to !Down)
|
|
IMGUI_API bool IsMouseReleased(int button); // did mouse button released (went from Down to !Down)
|
|
@@ -505,19 +524,16 @@ namespace ImGui
|
|
|
IMGUI_API void CaptureKeyboardFromApp(bool capture = true); // manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application handle). e.g. force capture keyboard when your widget is being hovered.
|
|
IMGUI_API void CaptureKeyboardFromApp(bool capture = true); // manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application handle). e.g. force capture keyboard when your widget is being hovered.
|
|
|
IMGUI_API void CaptureMouseFromApp(bool capture = true); // manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application handle).
|
|
IMGUI_API void CaptureMouseFromApp(bool capture = true); // manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application handle).
|
|
|
|
|
|
|
|
- // Helpers functions to access functions pointers in ImGui::GetIO()
|
|
|
|
|
- IMGUI_API void* MemAlloc(size_t sz);
|
|
|
|
|
- IMGUI_API void MemFree(void* ptr);
|
|
|
|
|
|
|
+ // Clipboard Utilities (also see the LogToClipboard() function to capture or output text data to the clipboard)
|
|
|
IMGUI_API const char* GetClipboardText();
|
|
IMGUI_API const char* GetClipboardText();
|
|
|
IMGUI_API void SetClipboardText(const char* text);
|
|
IMGUI_API void SetClipboardText(const char* text);
|
|
|
|
|
|
|
|
- // Internal context access - if you want to use multiple context, share context between modules (e.g. DLL). There is a default context created and active by default.
|
|
|
|
|
- // All contexts share a same ImFontAtlas by default. If you want different font atlas, you can new() them and overwrite the GetIO().Fonts variable of an ImGui context.
|
|
|
|
|
- IMGUI_API const char* GetVersion();
|
|
|
|
|
- IMGUI_API ImGuiContext* CreateContext(void* (*malloc_fn)(size_t) = NULL, void (*free_fn)(void*) = NULL);
|
|
|
|
|
- IMGUI_API void DestroyContext(ImGuiContext* ctx);
|
|
|
|
|
- IMGUI_API ImGuiContext* GetCurrentContext();
|
|
|
|
|
- IMGUI_API void SetCurrentContext(ImGuiContext* ctx);
|
|
|
|
|
|
|
+ // Memory Utilities
|
|
|
|
|
+ // All those functions are not reliant on the current context.
|
|
|
|
|
+ // If you reload the contents of imgui.cpp at runtime, you may need to call SetCurrentContext() + SetAllocatorFunctions() again.
|
|
|
|
|
+ IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void(*free_func)(void* ptr, void* user_data), void* user_data = NULL);
|
|
|
|
|
+ IMGUI_API void* MemAlloc(size_t size);
|
|
|
|
|
+ IMGUI_API void MemFree(void* ptr);
|
|
|
|
|
|
|
|
} // namespace ImGui
|
|
} // namespace ImGui
|
|
|
|
|
|
|
@@ -542,8 +558,12 @@ enum ImGuiWindowFlags_
|
|
|
ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x)
|
|
ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, // Always show horizontal scrollbar (even if ContentSize.x < Size.x)
|
|
|
ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
|
|
ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, // Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
|
|
|
ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // (WIP) Enable resize from any corners and borders. Your back-end needs to honor the different values of io.MouseCursor set by imgui.
|
|
ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // (WIP) Enable resize from any corners and borders. Your back-end needs to honor the different values of io.MouseCursor set by imgui.
|
|
|
|
|
+ ImGuiWindowFlags_NoNavInputs = 1 << 18, // No gamepad/keyboard navigation within the window
|
|
|
|
|
+ ImGuiWindowFlags_NoNavFocus = 1 << 19, // No focusing toward this window with gamepad/keyboard navigation (e.g. skipped by CTRL+TAB)
|
|
|
|
|
+ ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
|
|
|
|
|
|
|
|
// [Internal]
|
|
// [Internal]
|
|
|
|
|
+ ImGuiWindowFlags_NavFlattened = 1 << 23, // (WIP) Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
|
|
|
ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild()
|
|
ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild()
|
|
|
ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip()
|
|
ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip()
|
|
|
ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup()
|
|
ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup()
|
|
@@ -591,6 +611,7 @@ enum ImGuiTreeNodeFlags_
|
|
|
ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
|
|
ImGuiTreeNodeFlags_FramePadding = 1 << 10, // Use FramePadding (even for an unframed text node) to vertically align text baseline to regular widget height. Equivalent to calling AlignTextToFramePadding().
|
|
|
//ImGuITreeNodeFlags_SpanAllAvailWidth = 1 << 11, // FIXME: TODO: Extend hit box horizontally even if not framed
|
|
//ImGuITreeNodeFlags_SpanAllAvailWidth = 1 << 11, // FIXME: TODO: Extend hit box horizontally even if not framed
|
|
|
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 12, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
|
|
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 12, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
|
|
|
|
|
+ ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
|
|
|
ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoAutoOpenOnLog
|
|
ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoAutoOpenOnLog
|
|
|
|
|
|
|
|
// Obsolete names (will be removed)
|
|
// Obsolete names (will be removed)
|
|
@@ -623,6 +644,7 @@ enum ImGuiFocusedFlags_
|
|
|
{
|
|
{
|
|
|
ImGuiFocusedFlags_ChildWindows = 1 << 0, // IsWindowFocused(): Return true if any children of the window is focused
|
|
ImGuiFocusedFlags_ChildWindows = 1 << 0, // IsWindowFocused(): Return true if any children of the window is focused
|
|
|
ImGuiFocusedFlags_RootWindow = 1 << 1, // IsWindowFocused(): Test from root window (top most parent of the current hierarchy)
|
|
ImGuiFocusedFlags_RootWindow = 1 << 1, // IsWindowFocused(): Test from root window (top most parent of the current hierarchy)
|
|
|
|
|
+ ImGuiFocusedFlags_AnyWindow = 1 << 2, // IsWindowFocused(): Return true if any window is focused
|
|
|
ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows
|
|
ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -632,10 +654,11 @@ enum ImGuiHoveredFlags_
|
|
|
ImGuiHoveredFlags_Default = 0, // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them.
|
|
ImGuiHoveredFlags_Default = 0, // Return true if directly over the item/window, not obstructed by another window, not obstructed by an active popup or modal blocking inputs under them.
|
|
|
ImGuiHoveredFlags_ChildWindows = 1 << 0, // IsWindowHovered() only: Return true if any children of the window is hovered
|
|
ImGuiHoveredFlags_ChildWindows = 1 << 0, // IsWindowHovered() only: Return true if any children of the window is hovered
|
|
|
ImGuiHoveredFlags_RootWindow = 1 << 1, // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
|
|
ImGuiHoveredFlags_RootWindow = 1 << 1, // IsWindowHovered() only: Test from root window (top most parent of the current hierarchy)
|
|
|
- ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 2, // Return true even if a popup window is normally blocking access to this item/window
|
|
|
|
|
- //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 3, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
|
|
|
|
|
- ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 4, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
|
|
|
|
|
- ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 5, // Return true even if the position is overlapped by another window
|
|
|
|
|
|
|
+ ImGuiHoveredFlags_AnyWindow = 1 << 2, // IsWindowHovered() only: Return true if any window is hovered
|
|
|
|
|
+ ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 3, // Return true even if a popup window is normally blocking access to this item/window
|
|
|
|
|
+ //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 4, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
|
|
|
|
|
+ ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 5, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
|
|
|
|
|
+ ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 6, // Return true even if the position is overlapped by another window
|
|
|
ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped,
|
|
ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped,
|
|
|
ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows
|
|
ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows
|
|
|
};
|
|
};
|
|
@@ -655,26 +678,28 @@ enum ImGuiDragDropFlags_
|
|
|
ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery.
|
|
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 8-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 12-characters long 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_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.
|
|
#define IMGUI_PAYLOAD_TYPE_COLOR_4F "_COL4F" // float[4] // Standard type for colors. User code may use this type.
|
|
|
|
|
|
|
|
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
|
|
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
|
|
|
enum ImGuiKey_
|
|
enum ImGuiKey_
|
|
|
{
|
|
{
|
|
|
- ImGuiKey_Tab, // for tabbing through fields
|
|
|
|
|
- ImGuiKey_LeftArrow, // for text edit
|
|
|
|
|
- ImGuiKey_RightArrow,// for text edit
|
|
|
|
|
- ImGuiKey_UpArrow, // for text edit
|
|
|
|
|
- ImGuiKey_DownArrow, // for text edit
|
|
|
|
|
|
|
+ ImGuiKey_Tab,
|
|
|
|
|
+ ImGuiKey_LeftArrow,
|
|
|
|
|
+ ImGuiKey_RightArrow,
|
|
|
|
|
+ ImGuiKey_UpArrow,
|
|
|
|
|
+ ImGuiKey_DownArrow,
|
|
|
ImGuiKey_PageUp,
|
|
ImGuiKey_PageUp,
|
|
|
ImGuiKey_PageDown,
|
|
ImGuiKey_PageDown,
|
|
|
- ImGuiKey_Home, // for text edit
|
|
|
|
|
- ImGuiKey_End, // for text edit
|
|
|
|
|
- ImGuiKey_Delete, // for text edit
|
|
|
|
|
- ImGuiKey_Backspace, // for text edit
|
|
|
|
|
- ImGuiKey_Enter, // for text edit
|
|
|
|
|
- ImGuiKey_Escape, // for text edit
|
|
|
|
|
|
|
+ ImGuiKey_Home,
|
|
|
|
|
+ ImGuiKey_End,
|
|
|
|
|
+ ImGuiKey_Insert,
|
|
|
|
|
+ ImGuiKey_Delete,
|
|
|
|
|
+ ImGuiKey_Backspace,
|
|
|
|
|
+ ImGuiKey_Space,
|
|
|
|
|
+ ImGuiKey_Enter,
|
|
|
|
|
+ ImGuiKey_Escape,
|
|
|
ImGuiKey_A, // for text edit CTRL+A: select all
|
|
ImGuiKey_A, // for text edit CTRL+A: select all
|
|
|
ImGuiKey_C, // for text edit CTRL+C: copy
|
|
ImGuiKey_C, // for text edit CTRL+C: copy
|
|
|
ImGuiKey_V, // for text edit CTRL+V: paste
|
|
ImGuiKey_V, // for text edit CTRL+V: paste
|
|
@@ -684,6 +709,50 @@ enum ImGuiKey_
|
|
|
ImGuiKey_COUNT
|
|
ImGuiKey_COUNT
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// [BETA] Gamepad/Keyboard directional navigation
|
|
|
|
|
+// Keyboard: Set io.NavFlags |= ImGuiNavFlags_EnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeyDown[] + io.KeyMap[] arrays.
|
|
|
|
|
+// Gamepad: Set io.NavFlags |= ImGuiNavFlags_EnableGamepad to enable. Fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
|
|
|
|
|
+// Read instructions in imgui.cpp for more details.
|
|
|
|
|
+enum ImGuiNavInput_
|
|
|
|
|
+{
|
|
|
|
|
+ // Gamepad Mapping
|
|
|
|
|
+ ImGuiNavInput_Activate, // activate / open / toggle / tweak value // e.g. Circle (PS4), A (Xbox), B (Switch), Space (Keyboard)
|
|
|
|
|
+ ImGuiNavInput_Cancel, // cancel / close / exit // e.g. Cross (PS4), B (Xbox), A (Switch), Escape (Keyboard)
|
|
|
|
|
+ ImGuiNavInput_Input, // text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard)
|
|
|
|
|
+ ImGuiNavInput_Menu, // tap: toggle menu / hold: focus, move, resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard)
|
|
|
|
|
+ ImGuiNavInput_DpadLeft, // move / tweak / resize window (w/ PadMenu) // e.g. D-pad Left/Right/Up/Down (Gamepads), Arrow keys (Keyboard)
|
|
|
|
|
+ ImGuiNavInput_DpadRight, //
|
|
|
|
|
+ ImGuiNavInput_DpadUp, //
|
|
|
|
|
+ ImGuiNavInput_DpadDown, //
|
|
|
|
|
+ ImGuiNavInput_LStickLeft, // scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down
|
|
|
|
|
+ ImGuiNavInput_LStickRight, //
|
|
|
|
|
+ ImGuiNavInput_LStickUp, //
|
|
|
|
|
+ ImGuiNavInput_LStickDown, //
|
|
|
|
|
+ ImGuiNavInput_FocusPrev, // next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
|
|
|
|
|
+ ImGuiNavInput_FocusNext, // prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch)
|
|
|
|
|
+ ImGuiNavInput_TweakSlow, // slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
|
|
|
|
|
+ ImGuiNavInput_TweakFast, // faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch)
|
|
|
|
|
+
|
|
|
|
|
+ // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them.
|
|
|
|
|
+ // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) may be directly reading from io.KeyDown[] instead of io.NavInputs[].
|
|
|
|
|
+ ImGuiNavInput_KeyMenu_, // toggle menu // = io.KeyAlt
|
|
|
|
|
+ ImGuiNavInput_KeyLeft_, // move left // = Arrow keys
|
|
|
|
|
+ ImGuiNavInput_KeyRight_, // move right
|
|
|
|
|
+ ImGuiNavInput_KeyUp_, // move up
|
|
|
|
|
+ ImGuiNavInput_KeyDown_, // move down
|
|
|
|
|
+ ImGuiNavInput_COUNT,
|
|
|
|
|
+ ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyMenu_
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// [BETA] Gamepad/Keyboard directional navigation flags, stored in io.NavFlags
|
|
|
|
|
+enum ImGuiNavFlags_
|
|
|
|
|
+{
|
|
|
|
|
+ ImGuiNavFlags_EnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeyDown[].
|
|
|
|
|
+ ImGuiNavFlags_EnableGamepad = 1 << 1, // Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[].
|
|
|
|
|
+ ImGuiNavFlags_MoveMouse = 1 << 2, // Request navigation to allow moving the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantMoveMouse=true. If enabled you MUST honor io.WantMoveMouse requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth.
|
|
|
|
|
+ ImGuiNavFlags_NoCaptureKeyboard = 1 << 3 // Do not set the io.WantCaptureKeyboard flag with io.NavActive is set.
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// Enumeration for PushStyleColor() / PopStyleColor()
|
|
// Enumeration for PushStyleColor() / PopStyleColor()
|
|
|
enum ImGuiCol_
|
|
enum ImGuiCol_
|
|
|
{
|
|
{
|
|
@@ -730,6 +799,8 @@ enum ImGuiCol_
|
|
|
ImGuiCol_TextSelectedBg,
|
|
ImGuiCol_TextSelectedBg,
|
|
|
ImGuiCol_ModalWindowDarkening, // darken entire screen when a modal window is active
|
|
ImGuiCol_ModalWindowDarkening, // darken entire screen when a modal window is active
|
|
|
ImGuiCol_DragDropTarget,
|
|
ImGuiCol_DragDropTarget,
|
|
|
|
|
+ ImGuiCol_NavHighlight, // gamepad/keyboard: current highlighted item
|
|
|
|
|
+ ImGuiCol_NavWindowingHighlight, // gamepad/keyboard: when holding NavMenu to focus/move/resize windows
|
|
|
ImGuiCol_COUNT
|
|
ImGuiCol_COUNT
|
|
|
|
|
|
|
|
// Obsolete names (will be removed)
|
|
// Obsolete names (will be removed)
|
|
@@ -750,6 +821,7 @@ enum ImGuiStyleVar_
|
|
|
ImGuiStyleVar_WindowRounding, // float WindowRounding
|
|
ImGuiStyleVar_WindowRounding, // float WindowRounding
|
|
|
ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize
|
|
ImGuiStyleVar_WindowBorderSize, // float WindowBorderSize
|
|
|
ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize
|
|
ImGuiStyleVar_WindowMinSize, // ImVec2 WindowMinSize
|
|
|
|
|
+ ImGuiStyleVar_WindowTitleAlign, // ImVec2 WindowTitleAlign
|
|
|
ImGuiStyleVar_ChildRounding, // float ChildRounding
|
|
ImGuiStyleVar_ChildRounding, // float ChildRounding
|
|
|
ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize
|
|
ImGuiStyleVar_ChildBorderSize, // float ChildBorderSize
|
|
|
ImGuiStyleVar_PopupRounding, // float PopupRounding
|
|
ImGuiStyleVar_PopupRounding, // float PopupRounding
|
|
@@ -760,7 +832,10 @@ enum ImGuiStyleVar_
|
|
|
ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing
|
|
ImGuiStyleVar_ItemSpacing, // ImVec2 ItemSpacing
|
|
|
ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing
|
|
ImGuiStyleVar_ItemInnerSpacing, // ImVec2 ItemInnerSpacing
|
|
|
ImGuiStyleVar_IndentSpacing, // float IndentSpacing
|
|
ImGuiStyleVar_IndentSpacing, // float IndentSpacing
|
|
|
|
|
+ ImGuiStyleVar_ScrollbarSize, // float ScrollbarSize
|
|
|
|
|
+ ImGuiStyleVar_ScrollbarRounding, // float ScrollbarRounding
|
|
|
ImGuiStyleVar_GrabMinSize, // float GrabMinSize
|
|
ImGuiStyleVar_GrabMinSize, // float GrabMinSize
|
|
|
|
|
+ ImGuiStyleVar_GrabRounding, // float GrabRounding
|
|
|
ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
|
|
ImGuiStyleVar_ButtonTextAlign, // ImVec2 ButtonTextAlign
|
|
|
ImGuiStyleVar_Count_
|
|
ImGuiStyleVar_Count_
|
|
|
|
|
|
|
@@ -806,7 +881,7 @@ enum ImGuiMouseCursor_
|
|
|
ImGuiMouseCursor_None = -1,
|
|
ImGuiMouseCursor_None = -1,
|
|
|
ImGuiMouseCursor_Arrow = 0,
|
|
ImGuiMouseCursor_Arrow = 0,
|
|
|
ImGuiMouseCursor_TextInput, // When hovering over InputText, etc.
|
|
ImGuiMouseCursor_TextInput, // When hovering over InputText, etc.
|
|
|
- ImGuiMouseCursor_Move, // Unused
|
|
|
|
|
|
|
+ ImGuiMouseCursor_ResizeAll, // Unused
|
|
|
ImGuiMouseCursor_ResizeNS, // When hovering over an horizontal border
|
|
ImGuiMouseCursor_ResizeNS, // When hovering over an horizontal border
|
|
|
ImGuiMouseCursor_ResizeEW, // When hovering over a vertical border or a column
|
|
ImGuiMouseCursor_ResizeEW, // When hovering over a vertical border or a column
|
|
|
ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window
|
|
ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window
|
|
@@ -829,33 +904,36 @@ enum ImGuiCond_
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// You may modify the ImGui::GetStyle() main instance during initialization and before NewFrame().
|
|
|
|
|
+// During the frame, prefer using ImGui::PushStyleVar(ImGuiStyleVar_XXXX)/PopStyleVar() to alter the main style values, and ImGui::PushStyleColor(ImGuiCol_XXX)/PopStyleColor() for colors.
|
|
|
struct ImGuiStyle
|
|
struct ImGuiStyle
|
|
|
{
|
|
{
|
|
|
- float Alpha; // Global alpha applies to everything in ImGui
|
|
|
|
|
- ImVec2 WindowPadding; // Padding within a window
|
|
|
|
|
- float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows
|
|
|
|
|
- float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly)
|
|
|
|
|
- ImVec2 WindowMinSize; // Minimum window size
|
|
|
|
|
|
|
+ float Alpha; // Global alpha applies to everything in ImGui.
|
|
|
|
|
+ ImVec2 WindowPadding; // Padding within a window.
|
|
|
|
|
+ float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows.
|
|
|
|
|
+ float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
|
|
|
|
+ ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().
|
|
|
ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
|
|
ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
|
|
|
float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
|
|
float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
|
|
|
- float ChildBorderSize; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly)
|
|
|
|
|
|
|
+ float ChildBorderSize; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
|
|
float PopupRounding; // Radius of popup window corners rounding.
|
|
float PopupRounding; // Radius of popup window corners rounding.
|
|
|
- float PopupBorderSize; // Thickness of border around popup windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly)
|
|
|
|
|
- ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets)
|
|
|
|
|
|
|
+ float PopupBorderSize; // Thickness of border around popup windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
|
|
|
|
+ ImVec2 FramePadding; // Padding within a framed rectangle (used by most widgets).
|
|
|
float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
|
|
float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
|
|
|
- float FrameBorderSize; // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly)
|
|
|
|
|
- ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines
|
|
|
|
|
- ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
|
|
|
|
|
|
|
+ float FrameBorderSize; // Thickness of border around frames. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
|
|
|
|
+ ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines.
|
|
|
|
|
+ ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label).
|
|
|
ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
|
|
ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
|
|
|
float IndentSpacing; // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
|
|
float IndentSpacing; // Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
|
|
|
- float ColumnsMinSpacing; // Minimum horizontal spacing between two columns
|
|
|
|
|
- float ScrollbarSize; // Width of the vertical scrollbar, Height of the horizontal scrollbar
|
|
|
|
|
- float ScrollbarRounding; // Radius of grab corners for scrollbar
|
|
|
|
|
|
|
+ float ColumnsMinSpacing; // Minimum horizontal spacing between two columns.
|
|
|
|
|
+ float ScrollbarSize; // Width of the vertical scrollbar, Height of the horizontal scrollbar.
|
|
|
|
|
+ float ScrollbarRounding; // Radius of grab corners for scrollbar.
|
|
|
float GrabMinSize; // Minimum width/height of a grab box for slider/scrollbar.
|
|
float GrabMinSize; // Minimum width/height of a grab box for slider/scrollbar.
|
|
|
float GrabRounding; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
|
|
float GrabRounding; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
|
|
|
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f,0.5f) for horizontally+vertically centered.
|
|
ImVec2 ButtonTextAlign; // Alignment of button text when button is larger than text. Defaults to (0.5f,0.5f) for horizontally+vertically centered.
|
|
|
ImVec2 DisplayWindowPadding; // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
|
|
ImVec2 DisplayWindowPadding; // Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
|
|
|
ImVec2 DisplaySafeAreaPadding; // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
|
|
ImVec2 DisplaySafeAreaPadding; // If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
|
|
|
|
|
+ float MouseCursorScale; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
|
|
|
bool AntiAliasedLines; // Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
|
|
bool AntiAliasedLines; // Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
|
|
|
bool AntiAliasedFill; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
|
|
bool AntiAliasedFill; // Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
|
|
|
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
|
|
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
|
|
@@ -875,13 +953,14 @@ struct ImGuiIO
|
|
|
|
|
|
|
|
ImVec2 DisplaySize; // <unset> // Display size, in pixels. For clamping windows positions.
|
|
ImVec2 DisplaySize; // <unset> // Display size, in pixels. For clamping windows positions.
|
|
|
float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds.
|
|
float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds.
|
|
|
|
|
+ ImGuiNavFlags NavFlags; // = 0x00 // See ImGuiNavFlags_. Gamepad/keyboard navigation options.
|
|
|
float IniSavingRate; // = 5.0f // Maximum time between saving positions/sizes to .ini file, 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.
|
|
const char* IniFilename; // = "imgui.ini" // Path to .ini file. NULL to disable .ini saving.
|
|
|
const char* LogFilename; // = "imgui_log.txt" // Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
|
|
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 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.
|
|
float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
|
|
|
- float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging
|
|
|
|
|
- int KeyMap[ImGuiKey_COUNT]; // <unset> // Map of indices into the KeysDown[512] entries array
|
|
|
|
|
|
|
+ float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging.
|
|
|
|
|
+ int KeyMap[ImGuiKey_COUNT]; // <unset> // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state.
|
|
|
float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
|
|
float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
|
|
|
float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
|
|
float KeyRepeatRate; // = 0.050f // When holding a key/button, rate at which it repeats, in seconds.
|
|
|
void* UserData; // = NULL // Store your own data for retrieval by callbacks.
|
|
void* UserData; // = NULL // Store your own data for retrieval by callbacks.
|
|
@@ -902,41 +981,39 @@ struct ImGuiIO
|
|
|
// Settings (User Functions)
|
|
// Settings (User Functions)
|
|
|
//------------------------------------------------------------------
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
|
|
- // Rendering function, will be called in Render().
|
|
|
|
|
- // Alternatively you can keep this to NULL and call GetDrawData() after Render() to get the same pointer.
|
|
|
|
|
- // See example applications if you are unsure of how to implement this.
|
|
|
|
|
- void (*RenderDrawListsFn)(ImDrawData* data);
|
|
|
|
|
-
|
|
|
|
|
// Optional: access OS clipboard
|
|
// Optional: access OS clipboard
|
|
|
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
|
|
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
|
|
|
const char* (*GetClipboardTextFn)(void* user_data);
|
|
const char* (*GetClipboardTextFn)(void* user_data);
|
|
|
void (*SetClipboardTextFn)(void* user_data, const char* text);
|
|
void (*SetClipboardTextFn)(void* user_data, const char* text);
|
|
|
void* ClipboardUserData;
|
|
void* ClipboardUserData;
|
|
|
|
|
|
|
|
- // Optional: override memory allocations. MemFreeFn() may be called with a NULL pointer.
|
|
|
|
|
- // (default to posix malloc/free)
|
|
|
|
|
- void* (*MemAllocFn)(size_t sz);
|
|
|
|
|
- void (*MemFreeFn)(void* ptr);
|
|
|
|
|
-
|
|
|
|
|
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows)
|
|
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows)
|
|
|
// (default to use native imm32 api on Windows)
|
|
// (default to use native imm32 api on Windows)
|
|
|
void (*ImeSetInputScreenPosFn)(int x, int y);
|
|
void (*ImeSetInputScreenPosFn)(int x, int y);
|
|
|
void* ImeWindowHandle; // (Windows) Set this to your HWND to get automatic IME cursor positioning.
|
|
void* ImeWindowHandle; // (Windows) Set this to your HWND to get automatic IME cursor positioning.
|
|
|
|
|
|
|
|
|
|
+#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.
|
|
|
|
|
+ void (*RenderDrawListsFn)(ImDrawData* data);
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
//------------------------------------------------------------------
|
|
//------------------------------------------------------------------
|
|
|
// Input - Fill before calling NewFrame()
|
|
// Input - Fill before calling NewFrame()
|
|
|
//------------------------------------------------------------------
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
|
|
- ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
|
|
|
|
|
- bool MouseDown[5]; // Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
|
|
|
|
|
- float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text.
|
|
|
|
|
- bool MouseDrawCursor; // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
|
|
|
|
|
- bool KeyCtrl; // Keyboard modifier pressed: Control
|
|
|
|
|
- bool KeyShift; // Keyboard modifier pressed: Shift
|
|
|
|
|
- bool KeyAlt; // Keyboard modifier pressed: Alt
|
|
|
|
|
- bool KeySuper; // Keyboard modifier pressed: Cmd/Super/Windows
|
|
|
|
|
- bool KeysDown[512]; // Keyboard keys that are pressed (in whatever storage order you naturally have access to keyboard data)
|
|
|
|
|
- ImWchar InputCharacters[16+1]; // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
|
|
|
|
|
|
|
+ ImVec2 MousePos; // Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (on another screen, etc.)
|
|
|
|
|
+ bool MouseDown[5]; // Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
|
|
|
|
|
+ float MouseWheel; // Mouse wheel: 1 unit scrolls about 5 lines text.
|
|
|
|
|
+ float MouseWheelH; // Mouse wheel (Horizontal). Most users don't have a mouse with an horizontal wheel, may not be filled by all back-ends.
|
|
|
|
|
+ bool MouseDrawCursor; // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
|
|
|
|
|
+ bool KeyCtrl; // Keyboard modifier pressed: Control
|
|
|
|
|
+ bool KeyShift; // Keyboard modifier pressed: Shift
|
|
|
|
|
+ bool KeyAlt; // Keyboard modifier pressed: Alt
|
|
|
|
|
+ bool KeySuper; // Keyboard modifier pressed: Cmd/Super/Windows
|
|
|
|
|
+ bool KeysDown[512]; // Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
|
|
|
|
|
+ ImWchar InputCharacters[16+1]; // List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
|
|
|
|
|
+ float NavInputs[ImGuiNavInput_COUNT]; // Gamepad inputs (keyboard keys will be auto-mapped and be written here by ImGui::NewFrame)
|
|
|
|
|
|
|
|
// Functions
|
|
// Functions
|
|
|
IMGUI_API void AddInputCharacter(ImWchar c); // Add new character into InputCharacters[]
|
|
IMGUI_API void AddInputCharacter(ImWchar c); // Add new character into InputCharacters[]
|
|
@@ -950,9 +1027,10 @@ struct ImGuiIO
|
|
|
bool WantCaptureMouse; // When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application. This is set by ImGui when it wants to use your mouse (e.g. unclicked mouse is hovering a window, or a widget is active).
|
|
bool WantCaptureMouse; // When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application. This is set by ImGui when it wants to use your mouse (e.g. unclicked mouse is hovering a window, or a widget is active).
|
|
|
bool WantCaptureKeyboard; // When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application. This is set by ImGui when it wants to use your keyboard inputs.
|
|
bool WantCaptureKeyboard; // When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application. This is set by ImGui when it wants to use your keyboard inputs.
|
|
|
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 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 WantMoveMouse; // [BETA-NAV] MousePos has been altered, back-end should reposition mouse on next frame. Set only when 'NavMovesMouse=true'.
|
|
|
|
|
|
|
+ bool WantMoveMouse; // MousePos has been altered, back-end should reposition mouse on next frame. Set only when ImGuiNavFlags_MoveMouse flag is enabled in io.NavFlags.
|
|
|
|
|
+ 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
|
|
float Framerate; // Application framerate estimation, in frame per second. Solely for convenience. Rolling average estimation based on IO.DeltaTime over 120 frames
|
|
|
- int MetricsAllocs; // Number of active memory allocations
|
|
|
|
|
int MetricsRenderVertices; // Vertices output during last call to Render()
|
|
int MetricsRenderVertices; // Vertices output during last call to Render()
|
|
|
int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
|
|
int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
|
|
|
int MetricsActiveWindows; // Number of visible root windows (exclude child windows)
|
|
int MetricsActiveWindows; // Number of visible root windows (exclude child windows)
|
|
@@ -975,30 +1053,41 @@ struct ImGuiIO
|
|
|
float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point
|
|
float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point
|
|
|
float KeysDownDuration[512]; // Duration the keyboard key has been down (0.0f == just pressed)
|
|
float KeysDownDuration[512]; // Duration the keyboard key has been down (0.0f == just pressed)
|
|
|
float KeysDownDurationPrev[512]; // Previous duration the key has been down
|
|
float KeysDownDurationPrev[512]; // Previous duration the key has been down
|
|
|
|
|
+ float NavInputsDownDuration[ImGuiNavInput_COUNT];
|
|
|
|
|
+ float NavInputsDownDurationPrev[ImGuiNavInput_COUNT];
|
|
|
|
|
|
|
|
IMGUI_API ImGuiIO();
|
|
IMGUI_API ImGuiIO();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
|
-// Obsolete functions (Will be removed! Also see 'API BREAKING CHANGES' section in imgui.cpp)
|
|
|
|
|
|
|
+// Obsolete functions (Will be removed! Read 'API BREAKING CHANGES' section in imgui.cpp for details)
|
|
|
//-----------------------------------------------------------------------------
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
namespace ImGui
|
|
namespace ImGui
|
|
|
{
|
|
{
|
|
|
- static inline void ShowTestWindow() { return ShowDemoWindow(); } // OBSOLETE 1.53+
|
|
|
|
|
- static inline bool IsRootWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootWindow); } // OBSOLETE 1.53+
|
|
|
|
|
- static inline bool IsRootWindowOrAnyChildFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); } // OBSOLETE 1.53+
|
|
|
|
|
- static inline void SetNextWindowContentWidth(float width) { SetNextWindowContentSize(ImVec2(width, 0.0f)); } // OBSOLETE 1.53+ (nb: original version preserved last Y value set by SetNextWindowContentSize())
|
|
|
|
|
- static inline bool IsRootWindowOrAnyChildHovered(ImGuiHoveredFlags flags = 0) { return IsItemHovered(flags | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows); } // OBSOLETE 1.53+ use flags directly
|
|
|
|
|
- bool Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override = -1.0f, ImGuiWindowFlags flags = 0); // OBSOLETE 1.52+. use SetNextWindowSize() instead if you want to set a window size.
|
|
|
|
|
- static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); } // OBSOLETE 1.52+
|
|
|
|
|
- static inline void SetNextWindowPosCenter(ImGuiCond cond = 0) { SetNextWindowPos(ImVec2(GetIO().DisplaySize.x * 0.5f, GetIO().DisplaySize.y * 0.5f), cond, ImVec2(0.5f, 0.5f)); } // OBSOLETE 1.52+
|
|
|
|
|
- static inline bool IsItemHoveredRect() { return IsItemHovered(ImGuiHoveredFlags_RectOnly); } // OBSOLETE 1.51+
|
|
|
|
|
- static inline bool IsPosHoveringAnyWindow(const ImVec2&) { IM_ASSERT(0); return false; } // OBSOLETE 1.51+. This was partly broken. You probably wanted to use ImGui::GetIO().WantCaptureMouse instead.
|
|
|
|
|
- static inline bool IsMouseHoveringAnyWindow() { return IsAnyWindowHovered(); } // OBSOLETE 1.51+
|
|
|
|
|
- static inline bool IsMouseHoveringWindow() { return IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem); } // OBSOLETE 1.51+
|
|
|
|
|
- static inline bool CollapsingHeader(const char* label, const char* str_id, bool framed = true, bool default_open = false) { (void)str_id; (void)framed; ImGuiTreeNodeFlags default_open_flags = 1 << 5; return CollapsingHeader(label, (default_open ? default_open_flags : 0)); } // OBSOLETE 1.49+
|
|
|
|
|
|
|
+ // OBSOLETED in 1.60 (from Dec 2017)
|
|
|
|
|
+ static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); }
|
|
|
|
|
+ static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
|
|
|
|
|
+ static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { (void)on_edge; (void)outward; IM_ASSERT(0); return pos; }
|
|
|
|
|
+ // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
|
|
|
|
|
+ static inline void ShowTestWindow() { return ShowDemoWindow(); }
|
|
|
|
|
+ static inline bool IsRootWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootWindow); }
|
|
|
|
|
+ static inline bool IsRootWindowOrAnyChildFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); }
|
|
|
|
|
+ static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); }
|
|
|
|
|
+ static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); }
|
|
|
|
|
+ // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
|
|
|
|
|
+ bool Begin(const char* name, bool* p_open, const ImVec2& size_on_first_use, float bg_alpha_override = -1.0f, ImGuiWindowFlags flags = 0); // Use SetNextWindowSize(size, ImGuiCond_FirstUseEver) + SetNextWindowBgAlpha() instead.
|
|
|
|
|
+ static inline bool IsRootWindowOrAnyChildHovered() { return IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows); }
|
|
|
|
|
+ static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); }
|
|
|
|
|
+ static inline void SetNextWindowPosCenter(ImGuiCond c=0) { ImGuiIO& io = GetIO(); SetNextWindowPos(ImVec2(io.DisplaySize.x * 0.5f, io.DisplaySize.y * 0.5f), c, ImVec2(0.5f, 0.5f)); }
|
|
|
|
|
+ // OBSOLETED in 1.51 (between Jun 2017 and Aug 2017)
|
|
|
|
|
+ static inline bool IsItemHoveredRect() { return IsItemHovered(ImGuiHoveredFlags_RectOnly); }
|
|
|
|
|
+ static inline bool IsPosHoveringAnyWindow(const ImVec2&) { IM_ASSERT(0); return false; } // This was misleading and partly broken. You probably want to use the ImGui::GetIO().WantCaptureMouse flag instead.
|
|
|
|
|
+ static inline bool IsMouseHoveringAnyWindow() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
|
|
|
|
|
+ static inline bool IsMouseHoveringWindow() { return IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem); }
|
|
|
|
|
+ // OBSOLETED IN 1.49 (between Apr 2016 and May 2016)
|
|
|
|
|
+ static inline bool CollapsingHeader(const char* label, const char* str_id, bool framed = true, bool default_open = false) { (void)str_id; (void)framed; ImGuiTreeNodeFlags default_open_flags = 1 << 5; return CollapsingHeader(label, (default_open ? default_open_flags : 0)); }
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -1041,7 +1130,7 @@ public:
|
|
|
inline const value_type& back() const { IM_ASSERT(Size > 0); return Data[Size - 1]; }
|
|
inline const value_type& back() const { IM_ASSERT(Size > 0); return Data[Size - 1]; }
|
|
|
inline void swap(ImVector<T>& rhs) { int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
|
|
inline void swap(ImVector<T>& rhs) { int rhs_size = rhs.Size; rhs.Size = Size; Size = rhs_size; int rhs_cap = rhs.Capacity; rhs.Capacity = Capacity; Capacity = rhs_cap; value_type* rhs_data = rhs.Data; rhs.Data = Data; Data = rhs_data; }
|
|
|
|
|
|
|
|
- inline int _grow_capacity(int size) const { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > size ? new_capacity : size; }
|
|
|
|
|
|
|
+ inline int _grow_capacity(int sz) const { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
|
|
|
|
|
|
|
inline void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
|
|
inline void resize(int new_size) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); Size = new_size; }
|
|
|
inline void resize(int new_size, const T& v){ if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) Data[n] = v; Size = new_size; }
|
|
inline void resize(int new_size, const T& v){ if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) Data[n] = v; Size = new_size; }
|
|
@@ -1057,11 +1146,12 @@ public:
|
|
|
Capacity = new_capacity;
|
|
Capacity = new_capacity;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // NB: &v cannot be pointing inside the ImVector Data itself! e.g. v.push_back(v[10]) is forbidden.
|
|
|
inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); Data[Size++] = v; }
|
|
inline void push_back(const value_type& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); Data[Size++] = v; }
|
|
|
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
|
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
|
|
|
inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
|
inline void push_front(const value_type& v) { if (Size == 0) push_back(v); else insert(Data, v); }
|
|
|
|
|
|
|
|
- inline iterator erase(const_iterator it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(value_type)); Size--; return Data + off; }
|
|
|
|
|
|
|
+ inline iterator erase(const_iterator it) { IM_ASSERT(it >= Data && it < Data+Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(value_type)); Size--; return Data + off; }
|
|
|
inline iterator insert(const_iterator it, const value_type& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; return Data + off; }
|
|
inline iterator insert(const_iterator it, const value_type& v) { IM_ASSERT(it >= Data && it <= Data+Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(value_type)); Data[off] = v; Size++; return Data + off; }
|
|
|
inline bool contains(const value_type& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; }
|
|
inline bool contains(const value_type& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; }
|
|
|
};
|
|
};
|
|
@@ -1211,7 +1301,7 @@ struct ImGuiTextEditCallbackData
|
|
|
|
|
|
|
|
// Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
|
|
// Resizing callback data to apply custom constraint. As enabled by SetNextWindowSizeConstraints(). Callback is called during the next Begin().
|
|
|
// NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
|
|
// NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
|
|
|
-struct ImGuiSizeConstraintCallbackData
|
|
|
|
|
|
|
+struct ImGuiSizeCallbackData
|
|
|
{
|
|
{
|
|
|
void* UserData; // Read-only. What user passed to SetNextWindowSizeConstraints()
|
|
void* UserData; // Read-only. What user passed to SetNextWindowSizeConstraints()
|
|
|
ImVec2 Pos; // Read-only. Window position, for reference.
|
|
ImVec2 Pos; // Read-only. Window position, for reference.
|
|
@@ -1230,7 +1320,7 @@ struct ImGuiPayload
|
|
|
ImGuiID SourceId; // Source item id
|
|
ImGuiID SourceId; // Source item id
|
|
|
ImGuiID SourceParentId; // Source parent id (if available)
|
|
ImGuiID SourceParentId; // Source parent id (if available)
|
|
|
int DataFrameCount; // Data timestamp
|
|
int DataFrameCount; // Data timestamp
|
|
|
- char DataType[8 + 1]; // Data type tag (short user-supplied string)
|
|
|
|
|
|
|
+ char DataType[12 + 1]; // Data type tag (short user-supplied string, 12 characters max)
|
|
|
bool Preview; // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets)
|
|
bool Preview; // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets)
|
|
|
bool Delivery; // Set when AcceptDragDropPayload() was called and mouse button is released over the target item.
|
|
bool Delivery; // Set when AcceptDragDropPayload() was called and mouse button is released over the target item.
|
|
|
|
|
|
|
@@ -1409,12 +1499,13 @@ struct ImDrawList
|
|
|
int _ChannelsCount; // [Internal] number of active channels (1+)
|
|
int _ChannelsCount; // [Internal] number of active channels (1+)
|
|
|
ImVector<ImDrawChannel> _Channels; // [Internal] draw channels for columns API (not resized down so _ChannelsCount may be smaller than _Channels.Size)
|
|
ImVector<ImDrawChannel> _Channels; // [Internal] draw channels for columns API (not resized down so _ChannelsCount may be smaller than _Channels.Size)
|
|
|
|
|
|
|
|
|
|
+ // If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui)
|
|
|
ImDrawList(const ImDrawListSharedData* shared_data) { _Data = shared_data; _OwnerName = NULL; Clear(); }
|
|
ImDrawList(const ImDrawListSharedData* shared_data) { _Data = shared_data; _OwnerName = NULL; Clear(); }
|
|
|
~ImDrawList() { ClearFreeMemory(); }
|
|
~ImDrawList() { ClearFreeMemory(); }
|
|
|
IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
|
|
IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
|
|
|
IMGUI_API void PushClipRectFullScreen();
|
|
IMGUI_API void PushClipRectFullScreen();
|
|
|
IMGUI_API void PopClipRect();
|
|
IMGUI_API void PopClipRect();
|
|
|
- IMGUI_API void PushTextureID(const ImTextureID& texture_id);
|
|
|
|
|
|
|
+ IMGUI_API void PushTextureID(ImTextureID texture_id);
|
|
|
IMGUI_API void PopTextureID();
|
|
IMGUI_API void PopTextureID();
|
|
|
inline ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); }
|
|
inline ImVec2 GetClipRectMin() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.x, cr.y); }
|
|
|
inline ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); }
|
|
inline ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); }
|
|
@@ -1486,7 +1577,8 @@ struct ImDrawData
|
|
|
int TotalIdxCount; // For convenience, sum of all cmd_lists idx_buffer.Size
|
|
int TotalIdxCount; // For convenience, sum of all cmd_lists idx_buffer.Size
|
|
|
|
|
|
|
|
// Functions
|
|
// Functions
|
|
|
- ImDrawData() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; }
|
|
|
|
|
|
|
+ ImDrawData() { Clear(); }
|
|
|
|
|
+ void Clear() { Valid = false; CmdLists = NULL; CmdListsCount = TotalVtxCount = TotalIdxCount = 0; } // Draw lists are owned by the ImGuiContext and only pointed to here.
|
|
|
IMGUI_API void DeIndexAllBuffers(); // For backward compatibility or convenience: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
|
IMGUI_API void DeIndexAllBuffers(); // For backward compatibility or convenience: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
|
|
|
IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
|
|
IMGUI_API void ScaleClipRects(const ImVec2& sc); // Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
|
|
|
};
|
|
};
|
|
@@ -1522,6 +1614,12 @@ struct ImFontGlyph
|
|
|
float U0, V0, U1, V1; // Texture coordinates
|
|
float U0, V0, U1, V1; // Texture coordinates
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+enum ImFontAtlasFlags_
|
|
|
|
|
+{
|
|
|
|
|
+ ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0, // Don't round the height to next power of two
|
|
|
|
|
+ ImFontAtlasFlags_NoMouseCursors = 1 << 1 // Don't build software mouse cursors into the atlas
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// Load and rasterize multiple TTF/OTF fonts into a same texture.
|
|
// Load and rasterize multiple TTF/OTF fonts into a same texture.
|
|
|
// Sharing a texture for multiple fonts allows us to reduce the number of draw calls during rendering.
|
|
// Sharing a texture for multiple fonts allows us to reduce the number of draw calls during rendering.
|
|
|
// We also add custom graphic data into the texture that serves for ImGui.
|
|
// We also add custom graphic data into the texture that serves for ImGui.
|
|
@@ -1600,13 +1698,17 @@ struct ImFontAtlas
|
|
|
|
|
|
|
|
IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x10000. Id >= 0x80000000 are reserved for ImGui and ImDrawList
|
|
IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x10000. Id >= 0x80000000 are reserved for ImGui and ImDrawList
|
|
|
IMGUI_API int AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset = ImVec2(0,0)); // Id needs to be < 0x10000 to register a rectangle to map into a specific font.
|
|
IMGUI_API int AddCustomRectFontGlyph(ImFont* font, ImWchar id, int width, int height, float advance_x, const ImVec2& offset = ImVec2(0,0)); // Id needs to be < 0x10000 to register a rectangle to map into a specific font.
|
|
|
- IMGUI_API void CalcCustomRectUV(const CustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max);
|
|
|
|
|
const CustomRect* GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; }
|
|
const CustomRect* GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; }
|
|
|
|
|
|
|
|
|
|
+ // Internals
|
|
|
|
|
+ IMGUI_API void CalcCustomRectUV(const CustomRect* rect, ImVec2* out_uv_min, ImVec2* out_uv_max);
|
|
|
|
|
+ IMGUI_API bool GetMouseCursorTexData(ImGuiMouseCursor cursor, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]);
|
|
|
|
|
+
|
|
|
//-------------------------------------------
|
|
//-------------------------------------------
|
|
|
// Members
|
|
// Members
|
|
|
//-------------------------------------------
|
|
//-------------------------------------------
|
|
|
|
|
|
|
|
|
|
+ ImFontAtlasFlags Flags; // Build flags (see ImFontAtlasFlags_)
|
|
|
ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
|
|
ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
|
|
|
int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
|
|
int TexDesiredWidth; // Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
|
|
|
int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1.
|
|
int TexGlyphPadding; // Padding between glyphs within texture in pixels. Defaults to 1.
|
|
@@ -1617,6 +1719,7 @@ struct ImFontAtlas
|
|
|
unsigned int* TexPixelsRGBA32; // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
|
|
unsigned int* TexPixelsRGBA32; // 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
|
|
|
int TexWidth; // Texture width calculated during Build().
|
|
int TexWidth; // Texture width calculated during Build().
|
|
|
int TexHeight; // Texture height calculated during Build().
|
|
int TexHeight; // Texture height calculated during Build().
|
|
|
|
|
+ ImVec2 TexUvScale; // = (1.0f/TexWidth, 1.0f/TexHeight)
|
|
|
ImVec2 TexUvWhitePixel; // Texture coordinates to a white pixel
|
|
ImVec2 TexUvWhitePixel; // Texture coordinates to a white pixel
|
|
|
ImVector<ImFont*> Fonts; // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
|
|
ImVector<ImFont*> Fonts; // Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
|
|
|
ImVector<CustomRect> CustomRects; // Rectangles for packing custom texture data into the atlas.
|
|
ImVector<CustomRect> CustomRects; // Rectangles for packing custom texture data into the atlas.
|