|
@@ -1,4 +1,4 @@
|
|
|
-// dear imgui, v1.74 WIP
|
|
|
|
|
|
|
+// dear imgui, v1.75 WIP
|
|
|
// (headers)
|
|
// (headers)
|
|
|
|
|
|
|
|
// See imgui.cpp file for documentation.
|
|
// See imgui.cpp file for documentation.
|
|
@@ -48,8 +48,8 @@ Index of this file:
|
|
|
|
|
|
|
|
// Version
|
|
// Version
|
|
|
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
|
|
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
|
|
|
-#define IMGUI_VERSION "1.74 WIP"
|
|
|
|
|
-#define IMGUI_VERSION_NUM 17301
|
|
|
|
|
|
|
+#define IMGUI_VERSION "1.75 WIP"
|
|
|
|
|
+#define IMGUI_VERSION_NUM 17401
|
|
|
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
|
|
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
|
|
|
#define IMGUI_HAS_VIEWPORT 1 // Viewport WIP branch
|
|
#define IMGUI_HAS_VIEWPORT 1 // Viewport WIP branch
|
|
|
#define IMGUI_HAS_DOCK 1 // Docking WIP branch
|
|
#define IMGUI_HAS_DOCK 1 // Docking WIP branch
|
|
@@ -83,6 +83,8 @@ Index of this file:
|
|
|
#else
|
|
#else
|
|
|
#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Old style macro.
|
|
#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Old style macro.
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+#define IM_UNICODE_CODEPOINT_MAX 0xFFFF // Last Unicode code point supported by this build.
|
|
|
|
|
+#define IM_UNICODE_CODEPOINT_INVALID 0xFFFD // Standard invalid Unicode code point.
|
|
|
|
|
|
|
|
// Warnings
|
|
// Warnings
|
|
|
#if defined(__clang__)
|
|
#if defined(__clang__)
|
|
@@ -143,6 +145,7 @@ typedef int ImGuiDataType; // -> enum ImGuiDataType_ // Enum: A
|
|
|
typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction
|
|
typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction
|
|
|
typedef int ImGuiKey; // -> enum ImGuiKey_ // Enum: A key identifier (ImGui-side enum)
|
|
typedef int ImGuiKey; // -> enum ImGuiKey_ // Enum: A key identifier (ImGui-side enum)
|
|
|
typedef int ImGuiNavInput; // -> enum ImGuiNavInput_ // Enum: An input identifier for navigation
|
|
typedef int ImGuiNavInput; // -> enum ImGuiNavInput_ // Enum: An input identifier for navigation
|
|
|
|
|
+typedef int ImGuiMouseButton; // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle)
|
|
|
typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier
|
|
typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier
|
|
|
typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling
|
|
typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling
|
|
|
typedef int ImDrawCornerFlags; // -> enum ImDrawCornerFlags_ // Flags: for ImDrawList::AddRect(), AddRectFilled() etc.
|
|
typedef int ImDrawCornerFlags; // -> enum ImDrawCornerFlags_ // Flags: for ImDrawList::AddRect(), AddRectFilled() etc.
|
|
@@ -443,6 +446,7 @@ namespace ImGui
|
|
|
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
|
|
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
|
|
|
// - 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).
|
|
// - 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).
|
|
|
// - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits.
|
|
// - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits.
|
|
|
|
|
+ // - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum.
|
|
|
// - Use v_min > v_max to lock edits.
|
|
// - Use v_min > v_max to lock edits.
|
|
|
IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f); // If v_min >= v_max we have no bound
|
|
IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f); // If v_min >= v_max we have no bound
|
|
|
IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f);
|
|
IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", float power = 1.0f);
|
|
@@ -476,7 +480,7 @@ namespace ImGui
|
|
|
IMGUI_API bool VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f);
|
|
IMGUI_API bool VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format = NULL, float power = 1.0f);
|
|
|
|
|
|
|
|
// Widgets: Input with Keyboard
|
|
// Widgets: Input with Keyboard
|
|
|
- // - If you want to use InputText() with a dynamic string type such as std::string or your own, see misc/cpp/imgui_stdlib.h
|
|
|
|
|
|
|
+ // - If you want to use InputText() with std::string or any custom dynamic string type, see misc/cpp/imgui_stdlib.h and comments in imgui_demo.cpp.
|
|
|
// - Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc.
|
|
// - Most of the ImGuiInputTextFlags flags are only useful for InputText() and not for InputFloatX, InputIntX, InputDouble etc.
|
|
|
IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
IMGUI_API bool InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
|
IMGUI_API bool InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
IMGUI_API bool InputTextMultiline(const char* label, char* buf, size_t buf_size, const ImVec2& size = ImVec2(0,0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL);
|
|
@@ -575,22 +579,24 @@ namespace ImGui
|
|
|
// - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
|
|
// - Unless modal, they can be closed by clicking anywhere outside them, or by pressing ESCAPE.
|
|
|
// - Their visibility state (~bool) is held internally by imgui instead of being held by the programmer as we are used to with regular Begin() calls.
|
|
// - Their visibility state (~bool) is held internally by imgui instead of being held by the programmer as we are used to with regular Begin() calls.
|
|
|
// User can manipulate the visibility state by calling OpenPopup().
|
|
// User can manipulate the visibility state by calling OpenPopup().
|
|
|
|
|
+ // - We default to use the right mouse (ImGuiMouseButton_Right=1) for the Popup Context functions.
|
|
|
// (*) You can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup.
|
|
// (*) You can use IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup) to bypass it and detect hovering even when normally blocked by a popup.
|
|
|
// Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time.
|
|
// Those three properties are connected. The library needs to hold their visibility state because it can close popups at any time.
|
|
|
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 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 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 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 BeginPopupContextItem(const char* str_id = NULL, ImGuiMouseButton 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, ImGuiMouseButton 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, ImGuiMouseButton mouse_button = 1); // helper to open and begin popup when clicked in void (where there are no imgui windows).
|
|
|
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 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 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 (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors). return true when just opened.
|
|
|
|
|
|
|
+ IMGUI_API bool OpenPopupOnItemClick(const char* str_id = NULL, ImGuiMouseButton mouse_button = 1); // helper to open popup when clicked on last item (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors). return true when just opened.
|
|
|
IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open at the current begin-ed level of the popup stack.
|
|
IMGUI_API bool IsPopupOpen(const char* str_id); // return true if the popup is open at the current begin-ed level of the popup stack.
|
|
|
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.
|
|
|
|
|
|
|
|
// Columns
|
|
// Columns
|
|
|
// - You can also use SameLine(pos_x) to mimic simplified columns.
|
|
// - You can also use SameLine(pos_x) to mimic simplified columns.
|
|
|
// - The columns API is work-in-progress and rather lacking (columns are arguably the worst part of dear imgui at the moment!)
|
|
// - The columns API is work-in-progress and rather lacking (columns are arguably the worst part of dear imgui at the moment!)
|
|
|
|
|
+ // - There is a maximum of 64 columns.
|
|
|
// - By end of the 2019 we will expose a new 'Table' api which will replace columns.
|
|
// - By end of the 2019 we will expose a new 'Table' api which will replace columns.
|
|
|
IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true);
|
|
IMGUI_API void Columns(int count = 1, const char* id = NULL, bool border = true);
|
|
|
IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished
|
|
IMGUI_API void NextColumn(); // next column, defaults to current row or next row if the current row is finished
|
|
@@ -658,7 +664,7 @@ namespace ImGui
|
|
|
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. This will continuously return true while holding mouse button on an item. 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. This will continuously return true while holding mouse button on an item. 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 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) == IsMouseClicked(mouse_button) && IsItemHovered()
|
|
|
|
|
|
|
+ IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0); // is the last item clicked? (e.g. button/node just clicked on) == IsMouseClicked(mouse_button) && IsItemHovered()
|
|
|
IMGUI_API bool IsItemVisible(); // is the last item visible? (items may be out of sight because of clipping/scrolling)
|
|
IMGUI_API bool IsItemVisible(); // is the last item visible? (items may be out of sight because of clipping/scrolling)
|
|
|
IMGUI_API bool IsItemEdited(); // did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.
|
|
IMGUI_API bool IsItemEdited(); // did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.
|
|
|
IMGUI_API bool IsItemActivated(); // was the last item just made active (item was previously inactive).
|
|
IMGUI_API bool IsItemActivated(); // was the last item just made active (item was previously inactive).
|
|
@@ -697,27 +703,34 @@ namespace ImGui
|
|
|
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
|
|
IMGUI_API void ColorConvertRGBtoHSV(float r, float g, float b, float& out_h, float& out_s, float& out_v);
|
|
|
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
|
|
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
|
|
|
|
|
|
|
|
- // Inputs Utilities
|
|
|
|
|
|
|
+ // Inputs Utilities: Keyboard
|
|
|
|
|
+ // - For 'int user_key_index' you can use your own indices/enums according to how your backend/engine stored them in io.KeysDown[].
|
|
|
|
|
+ // - We don't know the meaning of those value. You can use GetKeyIndex() to map a ImGuiKey_ value into the user index.
|
|
|
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
|
|
IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
|
|
|
- IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index]. note that imgui doesn't know the semantic of each entry of io.KeysDown[]. Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]!
|
|
|
|
|
- IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down). if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
|
|
|
|
|
- IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)..
|
|
|
|
|
|
|
+ IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index].
|
|
|
|
|
+ IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
|
|
|
|
|
+ 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 (0=left, 1=right, 2=middle)
|
|
|
|
|
- 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) (0=left, 1=right, 2=middle)
|
|
|
|
|
- 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 IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
|
|
|
|
- IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true); // is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
|
|
|
|
|
- IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse
|
|
|
|
|
|
|
+ IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value = true); // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.
|
|
|
|
|
+
|
|
|
|
|
+ // Inputs Utilities: Mouse
|
|
|
|
|
+ // - To refer to a mouse button, you may use named enums in your code e.g. ImGuiMouseButton_Left, ImGuiMouseButton_Right.
|
|
|
|
|
+ // - You can also use regular integer: it is forever guaranteed that 0=Left, 1=Right, 2=Middle.
|
|
|
|
|
+ // - Dragging operations are only reported after mouse has moved a certain distance away from the initial clicking position (see 'lock_threshold' and 'io.MouseDraggingThreshold')
|
|
|
|
|
+ IMGUI_API bool IsMouseDown(ImGuiMouseButton button); // is mouse button held?
|
|
|
|
|
+ IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down)
|
|
|
|
|
+ IMGUI_API bool IsMouseReleased(ImGuiMouseButton button); // did mouse button released? (went from Down to !Down)
|
|
|
|
|
+ IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button); // did mouse button double-clicked? a double-click returns false in IsMouseClicked(). uses io.MouseDoubleClickTime.
|
|
|
|
|
+ IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
|
|
|
|
|
+ IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
|
|
|
|
|
+ IMGUI_API bool IsAnyMouseDown(); // is any mouse button held?
|
|
|
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
|
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
|
|
- IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve backup of mouse position at the time of opening popup we have BeginPopup() into
|
|
|
|
|
- IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lock_threshold < -1.0f uses io.MouseDraggingThreshold.
|
|
|
|
|
- IMGUI_API void ResetMouseDragDelta(int button = 0); //
|
|
|
|
|
|
|
+ IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves)
|
|
|
|
|
+ IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
|
|
|
|
|
+ IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
|
|
|
|
|
+ IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0); //
|
|
|
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
|
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
|
|
- IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
|
|
|
|
|
- IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value = true); // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.
|
|
|
|
|
|
|
+ IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired cursor type
|
|
|
IMGUI_API void CaptureMouseFromApp(bool want_capture_mouse_value = true); // attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.
|
|
IMGUI_API void CaptureMouseFromApp(bool want_capture_mouse_value = true); // attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.
|
|
|
|
|
|
|
|
// Clipboard Utilities (also see the LogToClipboard() function to capture or output text data to the clipboard)
|
|
// Clipboard Utilities (also see the LogToClipboard() function to capture or output text data to the clipboard)
|
|
@@ -795,8 +808,8 @@ enum ImGuiWindowFlags_
|
|
|
ImGuiWindowFlags_DockNodeHost = 1 << 29 // Don't use! For internal use by Begin()/NewFrame()
|
|
ImGuiWindowFlags_DockNodeHost = 1 << 29 // Don't use! For internal use by Begin()/NewFrame()
|
|
|
|
|
|
|
|
// [Obsolete]
|
|
// [Obsolete]
|
|
|
- //ImGuiWindowFlags_ShowBorders = 1 << 7, // --> Set style.FrameBorderSize=1.0f / style.WindowBorderSize=1.0f to enable borders around windows and items
|
|
|
|
|
- //ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // --> Set io.ConfigWindowsResizeFromEdges and make sure mouse cursors are supported by back-end (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors)
|
|
|
|
|
|
|
+ //ImGuiWindowFlags_ShowBorders = 1 << 7, // --> Set style.FrameBorderSize=1.0f or style.WindowBorderSize=1.0f to enable borders around items or windows.
|
|
|
|
|
+ //ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // --> Set io.ConfigWindowsResizeFromEdges=true and make sure mouse cursors are supported by back-end (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors)
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// Flags for ImGui::InputText()
|
|
// Flags for ImGui::InputText()
|
|
@@ -847,11 +860,6 @@ enum ImGuiTreeNodeFlags_
|
|
|
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_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
|
|
|
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
|
|
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
|
|
|
ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
|
|
ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
|
|
|
-
|
|
|
|
|
- // Obsolete names (will be removed)
|
|
|
|
|
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
|
|
- , ImGuiTreeNodeFlags_AllowOverlapMode = ImGuiTreeNodeFlags_AllowItemOverlap // [renamed in 1.53]
|
|
|
|
|
-#endif
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// Flags for ImGui::Selectable()
|
|
// Flags for ImGui::Selectable()
|
|
@@ -1092,7 +1100,7 @@ enum ImGuiBackendFlags_
|
|
|
ImGuiBackendFlags_HasGamepad = 1 << 0, // Back-end Platform supports gamepad and currently has one connected.
|
|
ImGuiBackendFlags_HasGamepad = 1 << 0, // Back-end Platform supports gamepad and currently has one connected.
|
|
|
ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Back-end Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
|
|
ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Back-end Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
|
|
|
ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Back-end Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
|
|
ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Back-end Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
|
|
|
- ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, // Back-end Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bits indices.
|
|
|
|
|
|
|
+ ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, // Back-end Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
|
|
|
|
|
|
|
|
// [BETA] Viewports
|
|
// [BETA] Viewports
|
|
|
ImGuiBackendFlags_PlatformHasViewports = 1 << 10, // Back-end Platform supports multiple viewports.
|
|
ImGuiBackendFlags_PlatformHasViewports = 1 << 10, // Back-end Platform supports multiple viewports.
|
|
@@ -1158,9 +1166,7 @@ enum ImGuiCol_
|
|
|
// Obsolete names (will be removed)
|
|
// Obsolete names (will be removed)
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
, ImGuiCol_ModalWindowDarkening = ImGuiCol_ModalWindowDimBg // [renamed in 1.63]
|
|
, ImGuiCol_ModalWindowDarkening = ImGuiCol_ModalWindowDimBg // [renamed in 1.63]
|
|
|
- , ImGuiCol_ChildWindowBg = ImGuiCol_ChildBg // [renamed in 1.53]
|
|
|
|
|
- //ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered, // [unused since 1.60+] the close button now uses regular button colors.
|
|
|
|
|
- //ImGuiCol_ComboBg, // [unused since 1.53+] ComboBg has been merged with PopupBg, so a redirect isn't accurate.
|
|
|
|
|
|
|
+ //, ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered// [unused since 1.60+] the close button now uses regular button colors.
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -1197,8 +1203,7 @@ enum ImGuiStyleVar_
|
|
|
|
|
|
|
|
// Obsolete names (will be removed)
|
|
// Obsolete names (will be removed)
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
- , ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT // [renamed in 1.60]
|
|
|
|
|
- , ImGuiStyleVar_ChildWindowRounding = ImGuiStyleVar_ChildRounding // [renamed in 1.53]
|
|
|
|
|
|
|
+ , ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT // [renamed in 1.60]
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -1247,6 +1252,16 @@ enum ImGuiColorEditFlags_
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// Identify a mouse button.
|
|
|
|
|
+// Those values are guaranteed to be stable and we frequently use 0/1 directly. Named enums provided for convenience.
|
|
|
|
|
+enum ImGuiMouseButton_
|
|
|
|
|
+{
|
|
|
|
|
+ ImGuiMouseButton_Left = 0,
|
|
|
|
|
+ ImGuiMouseButton_Right = 1,
|
|
|
|
|
+ ImGuiMouseButton_Middle = 2,
|
|
|
|
|
+ ImGuiMouseButton_COUNT = 5
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// Enumeration for GetMouseCursor()
|
|
// Enumeration for GetMouseCursor()
|
|
|
// User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here
|
|
// User code may request binding to display given cursor by calling SetMouseCursor(), which is why we have some cursors that are marked unused here
|
|
|
enum ImGuiMouseCursor_
|
|
enum ImGuiMouseCursor_
|
|
@@ -1260,6 +1275,7 @@ enum ImGuiMouseCursor_
|
|
|
ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window
|
|
ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window
|
|
|
ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window
|
|
ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window
|
|
|
ImGuiMouseCursor_Hand, // (Unused by Dear ImGui functions. Use for e.g. hyperlinks)
|
|
ImGuiMouseCursor_Hand, // (Unused by Dear ImGui functions. Use for e.g. hyperlinks)
|
|
|
|
|
+ ImGuiMouseCursor_NotAllowed, // When hovering something with disallowed interaction. Usually a crossed circle.
|
|
|
ImGuiMouseCursor_COUNT
|
|
ImGuiMouseCursor_COUNT
|
|
|
|
|
|
|
|
// Obsolete names (will be removed)
|
|
// Obsolete names (will be removed)
|
|
@@ -1268,7 +1284,7 @@ enum ImGuiMouseCursor_
|
|
|
#endif
|
|
#endif
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// Enumateration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions
|
|
|
|
|
|
|
+// Enumeration for ImGui::SetWindow***(), SetNextWindow***(), SetNextItem***() functions
|
|
|
// Represent a condition.
|
|
// Represent a condition.
|
|
|
// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
|
|
// Important: Treat as a regular enum! Do NOT combine multiple values using binary operators! All the functions above treat 0 as a shortcut to ImGuiCond_Always.
|
|
|
enum ImGuiCond_
|
|
enum ImGuiCond_
|
|
@@ -1345,6 +1361,7 @@ struct ImVector
|
|
|
inline int _grow_capacity(int sz) const { int new_capacity = Capacity ? (Capacity + Capacity/2) : 8; return new_capacity > sz ? new_capacity : sz; }
|
|
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++) memcpy(&Data[n], &v, sizeof(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++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; }
|
|
|
|
|
+ inline void shrink(int new_size) { IM_ASSERT(new_size <= Size); Size = new_size; } // Resize a vector to a smaller size, guaranteed not to cause a reallocation
|
|
|
inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; }
|
|
inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; }
|
|
|
|
|
|
|
|
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
|
|
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
|
|
@@ -1473,9 +1490,9 @@ struct ImGuiIO
|
|
|
// Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window) + User data for back-end/wrappers to store their own stuff.
|
|
// Optional: Platform/Renderer back-end name (informational only! will be displayed in About Window) + User data for back-end/wrappers to store their own stuff.
|
|
|
const char* BackendPlatformName; // = NULL
|
|
const char* BackendPlatformName; // = NULL
|
|
|
const char* BackendRendererName; // = NULL
|
|
const char* BackendRendererName; // = NULL
|
|
|
- void* BackendPlatformUserData; // = NULL
|
|
|
|
|
- void* BackendRendererUserData; // = NULL
|
|
|
|
|
- void* BackendLanguageUserData; // = NULL
|
|
|
|
|
|
|
+ void* BackendPlatformUserData; // = NULL // User data for platform back-end
|
|
|
|
|
+ void* BackendRendererUserData; // = NULL // User data for renderer back-end
|
|
|
|
|
+ void* BackendLanguageUserData; // = NULL // User data for non C++ programming language back-end
|
|
|
|
|
|
|
|
// 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)
|
|
@@ -1533,7 +1550,7 @@ struct ImGuiIO
|
|
|
ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
|
|
ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
|
|
|
|
|
|
|
|
//------------------------------------------------------------------
|
|
//------------------------------------------------------------------
|
|
|
- // [Internal] ImGui will maintain those fields. Forward compatibility not guaranteed!
|
|
|
|
|
|
|
+ // [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed!
|
|
|
//------------------------------------------------------------------
|
|
//------------------------------------------------------------------
|
|
|
|
|
|
|
|
ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
|
|
ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
|
|
@@ -1606,15 +1623,20 @@ struct ImGuiSizeCallbackData
|
|
|
ImVec2 DesiredSize; // Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing.
|
|
ImVec2 DesiredSize; // Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing.
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// [BETA] Rarely used / very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
|
|
|
|
|
-// Provide hints to the platform back-end via altered viewport flags (enable/disable OS decoration, OS task bar icons, etc.) and OS level parent/child relationships.
|
|
|
|
|
|
|
+// [ALPHA] Rarely used / very advanced uses only. Use with SetNextWindowClass() and DockSpace() functions.
|
|
|
|
|
+// Important: the content of this class is still highly WIP and likely to change and be refactored
|
|
|
|
|
+// before we stabilize Docking features. Please be mindful if using this.
|
|
|
|
|
+// Provide hints:
|
|
|
|
|
+// - To the platform back-end via altered viewport flags (enable/disable OS decoration, OS task bar icons, etc.)
|
|
|
|
|
+// - To the platform back-end for OS level parent/child relationships of viewport.
|
|
|
|
|
+// - To the docking system for various options and filtering.
|
|
|
struct ImGuiWindowClass
|
|
struct ImGuiWindowClass
|
|
|
{
|
|
{
|
|
|
- ImGuiID ClassId; // User data. 0 = Default class (unclassed)
|
|
|
|
|
|
|
+ ImGuiID ClassId; // User data. 0 = Default class (unclassed). Windows of different classes cannot be docked with each others.
|
|
|
ImGuiID ParentViewportId; // Hint for the platform back-end. If non-zero, the platform back-end can create a parent<>child relationship between the platform windows. Not conforming back-ends are free to e.g. parent every viewport to the main viewport or not.
|
|
ImGuiID ParentViewportId; // Hint for the platform back-end. If non-zero, the platform back-end can create a parent<>child relationship between the platform windows. Not conforming back-ends are free to e.g. parent every viewport to the main viewport or not.
|
|
|
ImGuiViewportFlags ViewportFlagsOverrideSet; // Viewport flags to set when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
|
ImGuiViewportFlags ViewportFlagsOverrideSet; // Viewport flags to set when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
|
|
ImGuiViewportFlags ViewportFlagsOverrideClear; // Viewport flags to clear when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
|
ImGuiViewportFlags ViewportFlagsOverrideClear; // Viewport flags to clear when a window of this class owns a viewport. This allows you to enforce OS decoration or task bar icon, override the defaults on a per-window basis.
|
|
|
- bool DockingAlwaysTabBar; // Set to true to enforce windows of this class always having their own tab (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
|
|
|
|
|
|
|
+ bool DockingAlwaysTabBar; // Set to true to enforce single floating windows of this class always having their own docking node (equivalent of setting the global io.ConfigDockingAlwaysTabBar)
|
|
|
bool DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window.
|
|
bool DockingAllowUnclassed; // Set to true to allow windows of this class to be docked/merged with an unclassed window.
|
|
|
|
|
|
|
|
ImGuiWindowClass() { ClassId = 0; ParentViewportId = 0; ViewportFlagsOverrideSet = ViewportFlagsOverrideClear = 0x00; DockingAlwaysTabBar = false; DockingAllowUnclassed = true; }
|
|
ImGuiWindowClass() { ClassId = 0; ParentViewportId = 0; ViewportFlagsOverrideSet = ViewportFlagsOverrideClear = 0x00; DockingAlwaysTabBar = false; DockingAllowUnclassed = true; }
|
|
@@ -1671,12 +1693,6 @@ namespace ImGui
|
|
|
static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); }
|
|
static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); }
|
|
|
static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
|
|
static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); }
|
|
|
static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { IM_UNUSED(on_edge); IM_UNUSED(outward); IM_ASSERT(0); return pos; }
|
|
static inline ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = 0.f) { IM_UNUSED(on_edge); IM_UNUSED(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(); }
|
|
|
|
|
}
|
|
}
|
|
|
typedef ImGuiInputTextCallback ImGuiTextEditCallback; // OBSOLETED in 1.63 (from Aug 2018): made the names consistent
|
|
typedef ImGuiInputTextCallback ImGuiTextEditCallback; // OBSOLETED in 1.63 (from Aug 2018): made the names consistent
|
|
|
typedef ImGuiInputTextCallbackData ImGuiTextEditCallbackData;
|
|
typedef ImGuiInputTextCallbackData ImGuiTextEditCallbackData;
|
|
@@ -1808,9 +1824,13 @@ struct ImGuiStorage
|
|
|
// - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
|
|
// - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
|
|
|
struct ImGuiListClipper
|
|
struct ImGuiListClipper
|
|
|
{
|
|
{
|
|
|
- float StartPosY;
|
|
|
|
|
|
|
+ int DisplayStart, DisplayEnd;
|
|
|
|
|
+ int ItemsCount;
|
|
|
|
|
+
|
|
|
|
|
+ // [Internal]
|
|
|
|
|
+ int StepNo;
|
|
|
float ItemsHeight;
|
|
float ItemsHeight;
|
|
|
- int ItemsCount, StepNo, DisplayStart, DisplayEnd;
|
|
|
|
|
|
|
+ float StartPosY;
|
|
|
|
|
|
|
|
// items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
|
|
// items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
|
|
|
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
|
|
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
|
|
@@ -1823,7 +1843,7 @@ struct ImGuiListClipper
|
|
|
IMGUI_API void End(); // Automatically called on the last call of Step() that returns false.
|
|
IMGUI_API void End(); // Automatically called on the last call of Step() that returns false.
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// Helpers macros to generate 32-bits encoded colors
|
|
|
|
|
|
|
+// Helpers macros to generate 32-bit encoded colors
|
|
|
#ifdef IMGUI_USE_BGRA_PACKED_COLOR
|
|
#ifdef IMGUI_USE_BGRA_PACKED_COLOR
|
|
|
#define IM_COL32_R_SHIFT 16
|
|
#define IM_COL32_R_SHIFT 16
|
|
|
#define IM_COL32_G_SHIFT 8
|
|
#define IM_COL32_G_SHIFT 8
|
|
@@ -1887,13 +1907,13 @@ typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* c
|
|
|
|
|
|
|
|
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
|
|
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
|
|
|
// Pre 1.71 back-ends will typically ignore the VtxOffset/IdxOffset fields. When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset'
|
|
// Pre 1.71 back-ends will typically ignore the VtxOffset/IdxOffset fields. When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset'
|
|
|
-// is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bits indices.
|
|
|
|
|
|
|
+// is enabled, those fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices.
|
|
|
struct ImDrawCmd
|
|
struct ImDrawCmd
|
|
|
{
|
|
{
|
|
|
unsigned int ElemCount; // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
|
|
unsigned int ElemCount; // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
|
|
|
ImVec4 ClipRect; // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
|
|
ImVec4 ClipRect; // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
|
|
|
ImTextureID TextureId; // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
|
|
ImTextureID TextureId; // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
|
|
|
- unsigned int VtxOffset; // Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0. With ImGuiBackendFlags_RendererHasVtxOffset: may be >0 to support meshes larger than 64K vertices with 16-bits indices.
|
|
|
|
|
|
|
+ unsigned int VtxOffset; // Start offset in vertex buffer. Pre-1.71 or without ImGuiBackendFlags_RendererHasVtxOffset: always 0. With ImGuiBackendFlags_RendererHasVtxOffset: may be >0 to support meshes larger than 64K vertices with 16-bit indices.
|
|
|
unsigned int IdxOffset; // Start offset in index buffer. Always equal to sum of ElemCount drawn so far.
|
|
unsigned int IdxOffset; // Start offset in index buffer. Always equal to sum of ElemCount drawn so far.
|
|
|
ImDrawCallback UserCallback; // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
|
|
ImDrawCallback UserCallback; // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
|
|
|
void* UserCallbackData; // The draw callback code can access this.
|
|
void* UserCallbackData; // The draw callback code can access this.
|
|
@@ -1902,8 +1922,8 @@ struct ImDrawCmd
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// Vertex index
|
|
// Vertex index
|
|
|
-// (to allow large meshes with 16-bits indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end)
|
|
|
|
|
-// (to use 32-bits indices: override with '#define ImDrawIdx unsigned int' in imconfig.h)
|
|
|
|
|
|
|
+// (to allow large meshes with 16-bit indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end)
|
|
|
|
|
+// (to use 32-bit indices: override with '#define ImDrawIdx unsigned int' in imconfig.h)
|
|
|
#ifndef ImDrawIdx
|
|
#ifndef ImDrawIdx
|
|
|
typedef unsigned short ImDrawIdx;
|
|
typedef unsigned short ImDrawIdx;
|
|
|
#endif
|
|
#endif
|
|
@@ -2012,7 +2032,7 @@ struct ImDrawList
|
|
|
// Primitives
|
|
// Primitives
|
|
|
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
|
|
|
IMGUI_API void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f);
|
|
IMGUI_API void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f);
|
|
|
- IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1.0f); // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4-bits corresponding to which corner to round
|
|
|
|
|
|
|
+ IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All, float thickness = 1.0f); // a: upper-left, b: lower-right (== upper-left + size), rounding_corners_flags: 4 bits corresponding to which corner to round
|
|
|
IMGUI_API void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); // a: upper-left, b: lower-right (== upper-left + size)
|
|
IMGUI_API void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All); // a: upper-left, b: lower-right (== upper-left + size)
|
|
|
IMGUI_API void AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
|
|
IMGUI_API void AddRectFilledMultiColor(const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left);
|
|
|
IMGUI_API void AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f);
|
|
IMGUI_API void AddQuad(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness = 1.0f);
|
|
@@ -2021,11 +2041,13 @@ struct ImDrawList
|
|
|
IMGUI_API void AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);
|
|
IMGUI_API void AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);
|
|
|
IMGUI_API void AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments = 12, float thickness = 1.0f);
|
|
IMGUI_API void AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments = 12, float thickness = 1.0f);
|
|
|
IMGUI_API void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 12);
|
|
IMGUI_API void AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments = 12);
|
|
|
|
|
+ IMGUI_API void AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness = 1.0f);
|
|
|
|
|
+ IMGUI_API void AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments);
|
|
|
IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
|
|
IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
|
|
|
IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
|
|
IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
|
|
|
IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, bool closed, float thickness);
|
|
IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, bool closed, float thickness);
|
|
|
IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); // Note: Anti-aliased filling requires points to be in clockwise order.
|
|
IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); // Note: Anti-aliased filling requires points to be in clockwise order.
|
|
|
- IMGUI_API void AddBezierCurve(const ImVec2& pos0, const ImVec2& cp0, const ImVec2& cp1, const ImVec2& pos1, ImU32 col, float thickness, int num_segments = 0);
|
|
|
|
|
|
|
+ IMGUI_API void AddBezierCurve(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0);
|
|
|
|
|
|
|
|
// Image primitives
|
|
// Image primitives
|
|
|
// - Read FAQ to understand what ImTextureID is.
|
|
// - Read FAQ to understand what ImTextureID is.
|
|
@@ -2043,7 +2065,7 @@ struct ImDrawList
|
|
|
inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); _Path.Size = 0; }
|
|
inline void PathStroke(ImU32 col, bool closed, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, closed, thickness); _Path.Size = 0; }
|
|
|
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 10);
|
|
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 10);
|
|
|
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
|
|
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
|
|
|
- IMGUI_API void PathBezierCurveTo(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, int num_segments = 0);
|
|
|
|
|
|
|
+ IMGUI_API void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0);
|
|
|
IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
|
|
IMGUI_API void PathRect(const ImVec2& rect_min, const ImVec2& rect_max, float rounding = 0.0f, ImDrawCornerFlags rounding_corners = ImDrawCornerFlags_All);
|
|
|
|
|
|
|
|
// Advanced
|
|
// Advanced
|
|
@@ -2063,6 +2085,7 @@ struct ImDrawList
|
|
|
IMGUI_API void Clear();
|
|
IMGUI_API void Clear();
|
|
|
IMGUI_API void ClearFreeMemory();
|
|
IMGUI_API void ClearFreeMemory();
|
|
|
IMGUI_API void PrimReserve(int idx_count, int vtx_count);
|
|
IMGUI_API void PrimReserve(int idx_count, int vtx_count);
|
|
|
|
|
+ IMGUI_API void PrimUnreserve(int idx_count, int vtx_count);
|
|
|
IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles)
|
|
IMGUI_API void PrimRect(const ImVec2& a, const ImVec2& b, ImU32 col); // Axis aligned rectangle (composed of two triangles)
|
|
|
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
|
|
IMGUI_API void PrimRectUV(const ImVec2& a, const ImVec2& b, const ImVec2& uv_a, const ImVec2& uv_b, ImU32 col);
|
|
|
IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
|
|
IMGUI_API void PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, const ImVec2& d, const ImVec2& uv_a, const ImVec2& uv_b, const ImVec2& uv_c, const ImVec2& uv_d, ImU32 col);
|
|
@@ -2142,7 +2165,7 @@ struct ImFontGlyphRangesBuilder
|
|
|
ImVector<ImU32> UsedChars; // Store 1-bit per Unicode code point (0=unused, 1=used)
|
|
ImVector<ImU32> UsedChars; // Store 1-bit per Unicode code point (0=unused, 1=used)
|
|
|
|
|
|
|
|
ImFontGlyphRangesBuilder() { Clear(); }
|
|
ImFontGlyphRangesBuilder() { Clear(); }
|
|
|
- inline void Clear() { int size_in_bytes = 0x10000 / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); }
|
|
|
|
|
|
|
+ inline void Clear() { int size_in_bytes = (IM_UNICODE_CODEPOINT_MAX+1) / 8; UsedChars.resize(size_in_bytes / (int)sizeof(ImU32)); memset(UsedChars.Data, 0, (size_t)size_in_bytes); }
|
|
|
inline bool GetBit(int n) const { int off = (n >> 5); ImU32 mask = 1u << (n & 31); return (UsedChars[off] & mask) != 0; } // Get bit n in the array
|
|
inline bool GetBit(int n) const { int off = (n >> 5); ImU32 mask = 1u << (n & 31); return (UsedChars[off] & mask) != 0; } // Get bit n in the array
|
|
|
inline void SetBit(int n) { int off = (n >> 5); ImU32 mask = 1u << (n & 31); UsedChars[off] |= mask; } // Set bit n in the array
|
|
inline void SetBit(int n) { int off = (n >> 5); ImU32 mask = 1u << (n & 31); UsedChars[off] |= mask; } // Set bit n in the array
|
|
|
inline void AddChar(ImWchar c) { SetBit(c); } // Add character
|
|
inline void AddChar(ImWchar c) { SetBit(c); } // Add character
|
|
@@ -2154,12 +2177,12 @@ struct ImFontGlyphRangesBuilder
|
|
|
// See ImFontAtlas::AddCustomRectXXX functions.
|
|
// See ImFontAtlas::AddCustomRectXXX functions.
|
|
|
struct ImFontAtlasCustomRect
|
|
struct ImFontAtlasCustomRect
|
|
|
{
|
|
{
|
|
|
- unsigned int ID; // Input // User ID. Use <0x10000 to map into a font glyph, >=0x10000 for other/internal/custom texture data.
|
|
|
|
|
|
|
+ unsigned int ID; // Input // User ID. Use < 0x110000 to map into a font glyph, >= 0x110000 for other/internal/custom texture data.
|
|
|
unsigned short Width, Height; // Input // Desired rectangle dimension
|
|
unsigned short Width, Height; // Input // Desired rectangle dimension
|
|
|
unsigned short X, Y; // Output // Packed position in Atlas
|
|
unsigned short X, Y; // Output // Packed position in Atlas
|
|
|
- float GlyphAdvanceX; // Input // For custom font glyphs only (ID<0x10000): glyph xadvance
|
|
|
|
|
- ImVec2 GlyphOffset; // Input // For custom font glyphs only (ID<0x10000): glyph display offset
|
|
|
|
|
- ImFont* Font; // Input // For custom font glyphs only (ID<0x10000): target font
|
|
|
|
|
|
|
+ float GlyphAdvanceX; // Input // For custom font glyphs only (ID < 0x110000): glyph xadvance
|
|
|
|
|
+ ImVec2 GlyphOffset; // Input // For custom font glyphs only (ID < 0x110000): glyph display offset
|
|
|
|
|
+ ImFont* Font; // Input // For custom font glyphs only (ID < 0x110000): target font
|
|
|
ImFontAtlasCustomRect() { ID = 0xFFFFFFFF; Width = Height = 0; X = Y = 0xFFFF; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0,0); Font = NULL; }
|
|
ImFontAtlasCustomRect() { ID = 0xFFFFFFFF; Width = Height = 0; X = Y = 0xFFFF; GlyphAdvanceX = 0.0f; GlyphOffset = ImVec2(0,0); Font = NULL; }
|
|
|
bool IsPacked() const { return X != 0xFFFF; }
|
|
bool IsPacked() const { return X != 0xFFFF; }
|
|
|
};
|
|
};
|
|
@@ -2238,9 +2261,9 @@ struct ImFontAtlas
|
|
|
// After calling Build(), you can query the rectangle position and render your pixels.
|
|
// After calling Build(), you can query the rectangle position and render your pixels.
|
|
|
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
|
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
|
|
// so you can render e.g. custom colorful icons and use them as regular glyphs.
|
|
// so you can render e.g. custom colorful icons and use them as regular glyphs.
|
|
|
- // Read misc/fonts/README.txt for more details about using colorful icons.
|
|
|
|
|
- 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.
|
|
|
|
|
|
|
+ // Read docs/FONTS.txt for more details about using colorful icons.
|
|
|
|
|
+ IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x110000. 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 < 0x110000 to register a rectangle to map into a specific font.
|
|
|
const ImFontAtlasCustomRect*GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; }
|
|
const ImFontAtlasCustomRect*GetCustomRectByIndex(int index) const { if (index < 0) return NULL; return &CustomRects[index]; }
|
|
|
|
|
|
|
|
// [Internal]
|
|
// [Internal]
|