|
@@ -1,4 +1,4 @@
|
|
|
-// dear imgui, v1.79
|
|
|
|
|
|
|
+// dear imgui, v1.80 WIP
|
|
|
// (main code and documentation)
|
|
// (main code and documentation)
|
|
|
|
|
|
|
|
// Help:
|
|
// Help:
|
|
@@ -167,21 +167,21 @@ CODE
|
|
|
GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE
|
|
GETTING STARTED WITH INTEGRATING DEAR IMGUI IN YOUR CODE/ENGINE
|
|
|
---------------------------------------------------------------
|
|
---------------------------------------------------------------
|
|
|
- Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library.
|
|
- Run and study the examples and demo in imgui_demo.cpp to get acquainted with the library.
|
|
|
- - In the majority of cases you should be able to use unmodified back-ends files available in the examples/ folder.
|
|
|
|
|
- - Add the Dear ImGui source files + selected back-end source files to your projects or using your preferred build system.
|
|
|
|
|
|
|
+ - In the majority of cases you should be able to use unmodified backends files available in the examples/ folder.
|
|
|
|
|
+ - Add the Dear ImGui source files + selected backend source files to your projects or using your preferred build system.
|
|
|
It is recommended you build and statically link the .cpp files as part of your project and NOT as shared library (DLL).
|
|
It is recommended you build and statically link the .cpp files as part of your project and NOT as shared library (DLL).
|
|
|
- You can later customize the imconfig.h file to tweak some compile-time behavior, such as integrating Dear ImGui types with your own maths types.
|
|
- You can later customize the imconfig.h file to tweak some compile-time behavior, such as integrating Dear ImGui types with your own maths types.
|
|
|
- When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables, functions and types to find comments about them.
|
|
- When using Dear ImGui, your programming IDE is your friend: follow the declaration of variables, functions and types to find comments about them.
|
|
|
- Dear ImGui never touches or knows about your GPU state. The only function that knows about GPU is the draw function that you provide.
|
|
- Dear ImGui never touches or knows about your GPU state. The only function that knows about GPU is the draw function that you provide.
|
|
|
Effectively it means you can create widgets at any time in your code, regardless of considerations of being in "update" vs "render"
|
|
Effectively it means you can create widgets at any time in your code, regardless of considerations of being in "update" vs "render"
|
|
|
phases of your own application. All rendering information are stored into command-lists that you will retrieve after calling ImGui::Render().
|
|
phases of your own application. All rendering information are stored into command-lists that you will retrieve after calling ImGui::Render().
|
|
|
- - Refer to the bindings and demo applications in the examples/ folder for instruction on how to setup your code.
|
|
|
|
|
|
|
+ - Refer to the backends and demo applications in the examples/ folder for instruction on how to setup your code.
|
|
|
- If you are running over a standard OS with a common graphics API, you should be able to use unmodified imgui_impl_*** files from the examples/ folder.
|
|
- If you are running over a standard OS with a common graphics API, you should be able to use unmodified imgui_impl_*** files from the examples/ folder.
|
|
|
|
|
|
|
|
|
|
|
|
|
HOW A SIMPLE APPLICATION MAY LOOK LIKE
|
|
HOW A SIMPLE APPLICATION MAY LOOK LIKE
|
|
|
--------------------------------------
|
|
--------------------------------------
|
|
|
- EXHIBIT 1: USING THE EXAMPLE BINDINGS (= imgui_impl_XXX.cpp files from the examples/ folder).
|
|
|
|
|
|
|
+ EXHIBIT 1: USING THE EXAMPLE BACKENDS (= imgui_impl_XXX.cpp files from the backends/ folder).
|
|
|
The sub-folders in examples/ contains examples applications following this structure.
|
|
The sub-folders in examples/ contains examples applications following this structure.
|
|
|
|
|
|
|
|
// Application init: create a dear imgui context, setup some options, load fonts
|
|
// Application init: create a dear imgui context, setup some options, load fonts
|
|
@@ -191,7 +191,7 @@ CODE
|
|
|
// TODO: Fill optional fields of the io structure later.
|
|
// TODO: Fill optional fields of the io structure later.
|
|
|
// TODO: Load TTF/OTF fonts if you don't want to use the default font.
|
|
// TODO: Load TTF/OTF fonts if you don't want to use the default font.
|
|
|
|
|
|
|
|
- // Initialize helper Platform and Renderer bindings (here we are using imgui_impl_win32.cpp and imgui_impl_dx11.cpp)
|
|
|
|
|
|
|
+ // Initialize helper Platform and Renderer backends (here we are using imgui_impl_win32.cpp and imgui_impl_dx11.cpp)
|
|
|
ImGui_ImplWin32_Init(hwnd);
|
|
ImGui_ImplWin32_Init(hwnd);
|
|
|
ImGui_ImplDX11_Init(g_pd3dDevice, g_pd3dDeviceContext);
|
|
ImGui_ImplDX11_Init(g_pd3dDevice, g_pd3dDeviceContext);
|
|
|
|
|
|
|
@@ -217,7 +217,7 @@ CODE
|
|
|
ImGui_ImplWin32_Shutdown();
|
|
ImGui_ImplWin32_Shutdown();
|
|
|
ImGui::DestroyContext();
|
|
ImGui::DestroyContext();
|
|
|
|
|
|
|
|
- EXHIBIT 2: IMPLEMENTING CUSTOM BINDING / CUSTOM ENGINE
|
|
|
|
|
|
|
+ EXHIBIT 2: IMPLEMENTING CUSTOM BACKEND / CUSTOM ENGINE
|
|
|
|
|
|
|
|
// Application init: create a dear imgui context, setup some options, load fonts
|
|
// Application init: create a dear imgui context, setup some options, load fonts
|
|
|
ImGui::CreateContext();
|
|
ImGui::CreateContext();
|
|
@@ -242,7 +242,7 @@ CODE
|
|
|
while (true)
|
|
while (true)
|
|
|
{
|
|
{
|
|
|
// Setup low-level inputs, e.g. on Win32: calling GetKeyboardState(), or write to those fields from your Windows message handlers, etc.
|
|
// Setup low-level inputs, e.g. on Win32: calling GetKeyboardState(), or write to those fields from your Windows message handlers, etc.
|
|
|
- // (In the examples/ app this is usually done within the ImGui_ImplXXX_NewFrame() function from one of the demo Platform bindings)
|
|
|
|
|
|
|
+ // (In the examples/ app this is usually done within the ImGui_ImplXXX_NewFrame() function from one of the demo Platform Backends)
|
|
|
io.DeltaTime = 1.0f/60.0f; // set the time elapsed since the previous frame (in seconds)
|
|
io.DeltaTime = 1.0f/60.0f; // set the time elapsed since the previous frame (in seconds)
|
|
|
io.DisplaySize.x = 1920.0f; // set the current display width
|
|
io.DisplaySize.x = 1920.0f; // set the current display width
|
|
|
io.DisplaySize.y = 1280.0f; // set the current display height here
|
|
io.DisplaySize.y = 1280.0f; // set the current display height here
|
|
@@ -278,7 +278,7 @@ CODE
|
|
|
|
|
|
|
|
HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE
|
|
HOW A SIMPLE RENDERING FUNCTION MAY LOOK LIKE
|
|
|
---------------------------------------------
|
|
---------------------------------------------
|
|
|
- The bindings in impl_impl_XXX.cpp files contains many working implementations of a rendering function.
|
|
|
|
|
|
|
+ The backends in impl_impl_XXX.cpp files contains many working implementations of a rendering function.
|
|
|
|
|
|
|
|
void void MyImGuiRenderFunction(ImDrawData* draw_data)
|
|
void void MyImGuiRenderFunction(ImDrawData* draw_data)
|
|
|
{
|
|
{
|
|
@@ -357,7 +357,7 @@ CODE
|
|
|
- On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag.
|
|
- On a TV/console system where readability may be lower or mouse inputs may be awkward, you may want to set the ImGuiConfigFlags_NavEnableSetMousePos flag.
|
|
|
Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements.
|
|
Enabling ImGuiConfigFlags_NavEnableSetMousePos + ImGuiBackendFlags_HasSetMousePos instructs dear imgui to move your mouse cursor along with navigation movements.
|
|
|
When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved.
|
|
When enabled, the NewFrame() function may alter 'io.MousePos' and set 'io.WantSetMousePos' to notify you that it wants the mouse cursor to be moved.
|
|
|
- When that happens your back-end NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the binding in examples/ do that.
|
|
|
|
|
|
|
+ When that happens your backend NEEDS to move the OS or underlying mouse cursor on the next frame. Some of the backends in examples/ do that.
|
|
|
(If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, imgui will misbehave as it will see your mouse as moving back and forth!)
|
|
(If you set the NavEnableSetMousePos flag but don't honor 'io.WantSetMousePos' properly, imgui will misbehave as it will see your mouse as moving back and forth!)
|
|
|
(In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want
|
|
(In a setup when you may not have easy control over the mouse cursor, e.g. uSynergy.c doesn't expose moving remote mouse cursor, you may want
|
|
|
to set a boolean to ignore your other external mouse positions until the external source is moved again.)
|
|
to set a boolean to ignore your other external mouse positions until the external source is moved again.)
|
|
@@ -371,6 +371,16 @@ CODE
|
|
|
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
|
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
|
|
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
|
|
|
|
|
|
|
|
+ - 2020/10/14 (1.80) - backends: moved all backends files (imgui_impl_XXXX.cpp, imgui_impl_XXXX.h) from examples/ to backends/.
|
|
|
|
|
+ - 2020/10/12 (1.80) - removed redirecting functions/enums that were marked obsolete in 1.60 (April 2018):
|
|
|
|
|
+ - io.RenderDrawListsFn pointer -> use ImGui::GetDrawData() value and call the render function of your backend
|
|
|
|
|
+ - ImGui::IsAnyWindowFocused() -> use ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow)
|
|
|
|
|
+ - ImGui::IsAnyWindowHovered() -> use ImGui::IsWindowHovered(ImGuiHoveredFlags_AnyWindow)
|
|
|
|
|
+ - ImGuiStyleVar_Count_ -> use ImGuiStyleVar_COUNT
|
|
|
|
|
+ - ImGuiMouseCursor_Count_ -> use ImGuiMouseCursor_COUNT
|
|
|
|
|
+ - removed redirecting functions names that were marked obsolete in 1.61 (May 2018):
|
|
|
|
|
+ - InputFloat (... int decimal_precision ...) -> use InputFloat (... const char* format ...) with format = "%.Xf" where X is your value for decimal_precision.
|
|
|
|
|
+ - same for InputFloat2()/InputFloat3()/InputFloat4() variants taking a `int decimal_precision` parameter.
|
|
|
- 2020/10/05 (1.79) - removed ImGuiListClipper: Renamed constructor parameters which created an ambiguous alternative to using the ImGuiListClipper::Begin() function, with misleading edge cases (note: imgui_memory_editor <0.40 from imgui_club/ used this old clipper API. Update your copy if needed).
|
|
- 2020/10/05 (1.79) - removed ImGuiListClipper: Renamed constructor parameters which created an ambiguous alternative to using the ImGuiListClipper::Begin() function, with misleading edge cases (note: imgui_memory_editor <0.40 from imgui_club/ used this old clipper API. Update your copy if needed).
|
|
|
- 2020/09/25 (1.79) - renamed ImGuiSliderFlags_ClampOnInput to ImGuiSliderFlags_AlwaysClamp. Kept redirection enum (will obsolete sooner because previous name was added recently).
|
|
- 2020/09/25 (1.79) - renamed ImGuiSliderFlags_ClampOnInput to ImGuiSliderFlags_AlwaysClamp. Kept redirection enum (will obsolete sooner because previous name was added recently).
|
|
|
- 2020/09/25 (1.79) - renamed style.TabMinWidthForUnselectedCloseButton to style.TabMinWidthForCloseButton.
|
|
- 2020/09/25 (1.79) - renamed style.TabMinWidthForUnselectedCloseButton to style.TabMinWidthForCloseButton.
|
|
@@ -453,10 +463,10 @@ CODE
|
|
|
- 2018/08/01 (1.63) - renamed io.OptCursorBlink to io.ConfigCursorBlink [-> io.ConfigInputTextCursorBlink in 1.65], io.OptMacOSXBehaviors to ConfigMacOSXBehaviors for consistency.
|
|
- 2018/08/01 (1.63) - renamed io.OptCursorBlink to io.ConfigCursorBlink [-> io.ConfigInputTextCursorBlink in 1.65], io.OptMacOSXBehaviors to ConfigMacOSXBehaviors for consistency.
|
|
|
- 2018/07/22 (1.63) - changed ImGui::GetTime() return value from float to double to avoid accumulating floating point imprecisions over time.
|
|
- 2018/07/22 (1.63) - changed ImGui::GetTime() return value from float to double to avoid accumulating floating point imprecisions over time.
|
|
|
- 2018/07/08 (1.63) - style: renamed ImGuiCol_ModalWindowDarkening to ImGuiCol_ModalWindowDimBg for consistency with other features. Kept redirection enum (will obsolete).
|
|
- 2018/07/08 (1.63) - style: renamed ImGuiCol_ModalWindowDarkening to ImGuiCol_ModalWindowDimBg for consistency with other features. Kept redirection enum (will obsolete).
|
|
|
- - 2018/06/08 (1.62) - examples: the imgui_impl_xxx files have been split to separate platform (Win32, Glfw, SDL2, etc.) from renderer (DX11, OpenGL, Vulkan, etc.).
|
|
|
|
|
- old bindings will still work as is, however prefer using the separated bindings as they will be updated to support multi-viewports.
|
|
|
|
|
- when adopting new bindings follow the main.cpp code of your preferred examples/ folder to know which functions to call.
|
|
|
|
|
- in particular, note that old bindings called ImGui::NewFrame() at the end of their ImGui_ImplXXXX_NewFrame() function.
|
|
|
|
|
|
|
+ - 2018/06/08 (1.62) - examples: the imgui_impl_XXX files have been split to separate platform (Win32, GLFW, SDL2, etc.) from renderer (DX11, OpenGL, Vulkan, etc.).
|
|
|
|
|
+ old backends will still work as is, however prefer using the separated backends as they will be updated to support multi-viewports.
|
|
|
|
|
+ when adopting new backends follow the main.cpp code of your preferred examples/ folder to know which functions to call.
|
|
|
|
|
+ in particular, note that old backends called ImGui::NewFrame() at the end of their ImGui_ImplXXXX_NewFrame() function.
|
|
|
- 2018/06/06 (1.62) - renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish other variants and discourage using the full set.
|
|
- 2018/06/06 (1.62) - renamed GetGlyphRangesChinese() to GetGlyphRangesChineseFull() to distinguish other variants and discourage using the full set.
|
|
|
- 2018/06/06 (1.62) - TreeNodeEx()/TreeNodeBehavior(): the ImGuiTreeNodeFlags_CollapsingHeader helper now include the ImGuiTreeNodeFlags_NoTreePushOnOpen flag. See Changelog for details.
|
|
- 2018/06/06 (1.62) - TreeNodeEx()/TreeNodeBehavior(): the ImGuiTreeNodeFlags_CollapsingHeader helper now include the ImGuiTreeNodeFlags_NoTreePushOnOpen flag. See Changelog for details.
|
|
|
- 2018/05/03 (1.61) - DragInt(): the default compile-time format string has been changed from "%.0f" to "%d", as we are not using integers internally any more.
|
|
- 2018/05/03 (1.61) - DragInt(): the default compile-time format string has been changed from "%.0f" to "%d", as we are not using integers internally any more.
|
|
@@ -466,7 +476,7 @@ CODE
|
|
|
- 2018/04/28 (1.61) - obsoleted InputFloat() functions taking an optional "int decimal_precision" in favor of an equivalent and more flexible "const char* format",
|
|
- 2018/04/28 (1.61) - obsoleted InputFloat() functions taking an optional "int decimal_precision" in favor of an equivalent and more flexible "const char* format",
|
|
|
consistent with other functions. Kept redirection functions (will obsolete).
|
|
consistent with other functions. Kept redirection functions (will obsolete).
|
|
|
- 2018/04/09 (1.61) - IM_DELETE() helper function added in 1.60 doesn't clear the input _pointer_ reference, more consistent with expectation and allows passing r-value.
|
|
- 2018/04/09 (1.61) - IM_DELETE() helper function added in 1.60 doesn't clear the input _pointer_ reference, more consistent with expectation and allows passing r-value.
|
|
|
- - 2018/03/20 (1.60) - renamed io.WantMoveMouse to io.WantSetMousePos for consistency and ease of understanding (was added in 1.52, _not_ used by core and only honored by some binding ahead of merging the Nav branch).
|
|
|
|
|
|
|
+ - 2018/03/20 (1.60) - renamed io.WantMoveMouse to io.WantSetMousePos for consistency and ease of understanding (was added in 1.52, _not_ used by core and only honored by some backend ahead of merging the Nav branch).
|
|
|
- 2018/03/12 (1.60) - removed ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered as the closing cross uses regular button colors now.
|
|
- 2018/03/12 (1.60) - removed ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered as the closing cross uses regular button colors now.
|
|
|
- 2018/03/08 (1.60) - changed ImFont::DisplayOffset.y to default to 0 instead of +1. Fixed rounding of Ascent/Descent to match TrueType renderer. If you were adding or subtracting to ImFont::DisplayOffset check if your fonts are correctly aligned vertically.
|
|
- 2018/03/08 (1.60) - changed ImFont::DisplayOffset.y to default to 0 instead of +1. Fixed rounding of Ascent/Descent to match TrueType renderer. If you were adding or subtracting to ImFont::DisplayOffset check if your fonts are correctly aligned vertically.
|
|
|
- 2018/03/03 (1.60) - renamed ImGuiStyleVar_Count_ to ImGuiStyleVar_COUNT and ImGuiMouseCursor_Count_ to ImGuiMouseCursor_COUNT for consistency with other public enums.
|
|
- 2018/03/03 (1.60) - renamed ImGuiStyleVar_Count_ to ImGuiStyleVar_COUNT and ImGuiMouseCursor_Count_ to ImGuiMouseCursor_COUNT for consistency with other public enums.
|
|
@@ -510,7 +520,7 @@ CODE
|
|
|
- 2017/10/11 (1.52) - renamed AlignFirstTextHeightToWidgets() to AlignTextToFramePadding(). Kept inline redirection function (will obsolete).
|
|
- 2017/10/11 (1.52) - renamed AlignFirstTextHeightToWidgets() to AlignTextToFramePadding(). Kept inline redirection function (will obsolete).
|
|
|
- 2017/09/26 (1.52) - renamed ImFont::Glyph to ImFontGlyph. Kept redirection typedef (will obsolete).
|
|
- 2017/09/26 (1.52) - renamed ImFont::Glyph to ImFontGlyph. Kept redirection typedef (will obsolete).
|
|
|
- 2017/09/25 (1.52) - removed SetNextWindowPosCenter() because SetNextWindowPos() now has the optional pivot information to do the same and more. Kept redirection function (will obsolete).
|
|
- 2017/09/25 (1.52) - removed SetNextWindowPosCenter() because SetNextWindowPos() now has the optional pivot information to do the same and more. Kept redirection function (will obsolete).
|
|
|
- - 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previously ImVec2(-1,-1) was enough but we now accept negative mouse coordinates. In your binding if you need to support unavailable mouse, make sure to replace "io.MousePos = ImVec2(-1,-1)" with "io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX)".
|
|
|
|
|
|
|
+ - 2017/08/25 (1.52) - io.MousePos needs to be set to ImVec2(-FLT_MAX,-FLT_MAX) when mouse is unavailable/missing. Previously ImVec2(-1,-1) was enough but we now accept negative mouse coordinates. In your backend if you need to support unavailable mouse, make sure to replace "io.MousePos = ImVec2(-1,-1)" with "io.MousePos = ImVec2(-FLT_MAX,-FLT_MAX)".
|
|
|
- 2017/08/22 (1.51) - renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection function (will obsolete). -> (1.52) use IsItemHovered(ImGuiHoveredFlags_RectOnly)!
|
|
- 2017/08/22 (1.51) - renamed IsItemHoveredRect() to IsItemRectHovered(). Kept inline redirection function (will obsolete). -> (1.52) use IsItemHovered(ImGuiHoveredFlags_RectOnly)!
|
|
|
- renamed IsMouseHoveringAnyWindow() to IsAnyWindowHovered() for consistency. Kept inline redirection function (will obsolete).
|
|
- renamed IsMouseHoveringAnyWindow() to IsAnyWindowHovered() for consistency. Kept inline redirection function (will obsolete).
|
|
|
- renamed IsMouseHoveringWindow() to IsWindowRectHovered() for consistency. Kept inline redirection function (will obsolete).
|
|
- renamed IsMouseHoveringWindow() to IsWindowRectHovered() for consistency. Kept inline redirection function (will obsolete).
|
|
@@ -557,7 +567,7 @@ CODE
|
|
|
you need to render your textured triangles with bilinear filtering to benefit from sub-pixel positioning of text.
|
|
you need to render your textured triangles with bilinear filtering to benefit from sub-pixel positioning of text.
|
|
|
- 2015/07/08 (1.43) - switched rendering data to use indexed rendering. this is saving a fair amount of CPU/GPU and enables us to get anti-aliasing for a marginal cost.
|
|
- 2015/07/08 (1.43) - switched rendering data to use indexed rendering. this is saving a fair amount of CPU/GPU and enables us to get anti-aliasing for a marginal cost.
|
|
|
this necessary change will break your rendering function! the fix should be very easy. sorry for that :(
|
|
this necessary change will break your rendering function! the fix should be very easy. sorry for that :(
|
|
|
- - if you are using a vanilla copy of one of the imgui_impl_XXXX.cpp provided in the example, you just need to update your copy and you can ignore the rest.
|
|
|
|
|
|
|
+ - if you are using a vanilla copy of one of the imgui_impl_XXX.cpp provided in the example, you just need to update your copy and you can ignore the rest.
|
|
|
- the signature of the io.RenderDrawListsFn handler has changed!
|
|
- the signature of the io.RenderDrawListsFn handler has changed!
|
|
|
old: ImGui_XXXX_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
|
|
old: ImGui_XXXX_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_count)
|
|
|
new: ImGui_XXXX_RenderDrawLists(ImDrawData* draw_data).
|
|
new: ImGui_XXXX_RenderDrawLists(ImDrawData* draw_data).
|
|
@@ -810,7 +820,7 @@ CODE
|
|
|
static const float NAV_WINDOWING_HIGHLIGHT_DELAY = 0.20f; // Time before the highlight and screen dimming starts fading in
|
|
static const float NAV_WINDOWING_HIGHLIGHT_DELAY = 0.20f; // Time before the highlight and screen dimming starts fading in
|
|
|
static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time before the window list starts to appear
|
|
static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time before the window list starts to appear
|
|
|
|
|
|
|
|
-// Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by back-end)
|
|
|
|
|
|
|
+// Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by backend)
|
|
|
static const float WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS = 4.0f; // Extend outside and inside windows. Affect FindHoveredWindow().
|
|
static const float WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS = 4.0f; // Extend outside and inside windows. Affect FindHoveredWindow().
|
|
|
static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time.
|
|
static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time.
|
|
|
static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 2.00f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved.
|
|
static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 2.00f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved.
|
|
@@ -954,7 +964,7 @@ ImGuiStyle::ImGuiStyle()
|
|
|
DisplaySafeAreaPadding = ImVec2(3,3); // 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.
|
|
DisplaySafeAreaPadding = ImVec2(3,3); // 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.
|
|
|
MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
|
|
MouseCursorScale = 1.0f; // Scale software rendered mouse cursor (when io.MouseDrawCursor is enabled). May be removed later.
|
|
|
AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU.
|
|
AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU.
|
|
|
- AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require back-end to render with bilinear filtering.
|
|
|
|
|
|
|
+ AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering.
|
|
|
AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.).
|
|
AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.).
|
|
|
CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
|
|
CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
|
|
|
CircleSegmentMaxError = 1.60f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
|
|
CircleSegmentMaxError = 1.60f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
|
|
@@ -1040,10 +1050,6 @@ ImGuiIO::ImGuiIO()
|
|
|
ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl;
|
|
ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl;
|
|
|
ImeWindowHandle = NULL;
|
|
ImeWindowHandle = NULL;
|
|
|
|
|
|
|
|
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
|
|
- RenderDrawListsFn = NULL;
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
// Input (NB: we already have memset zero the entire structure!)
|
|
// Input (NB: we already have memset zero the entire structure!)
|
|
|
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
|
MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
@@ -3312,13 +3318,31 @@ void ImGui::DestroyContext(ImGuiContext* ctx)
|
|
|
IM_DELETE(ctx);
|
|
IM_DELETE(ctx);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// No specific ordering/dependency support, will see as needed
|
|
|
|
|
+void ImGui::AddContextHook(ImGuiContext* ctx, const ImGuiContextHook* hook)
|
|
|
|
|
+{
|
|
|
|
|
+ ImGuiContext& g = *ctx;
|
|
|
|
|
+ IM_ASSERT(hook->Callback != NULL);
|
|
|
|
|
+ g.Hooks.push_back(*hook);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// Call context hooks (used by e.g. test engine)
|
|
|
|
|
+// We assume a small number of hooks so all stored in same array
|
|
|
|
|
+void ImGui::CallContextHooks(ImGuiContext* ctx, ImGuiContextHookType hook_type)
|
|
|
|
|
+{
|
|
|
|
|
+ ImGuiContext& g = *ctx;
|
|
|
|
|
+ for (int n = 0; n < g.Hooks.Size; n++)
|
|
|
|
|
+ if (g.Hooks[n].Type == hook_type)
|
|
|
|
|
+ g.Hooks[n].Callback(&g, &g.Hooks[n]);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
ImGuiIO& ImGui::GetIO()
|
|
ImGuiIO& ImGui::GetIO()
|
|
|
{
|
|
{
|
|
|
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
|
|
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
|
|
|
return GImGui->IO;
|
|
return GImGui->IO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Same value as passed to the old io.RenderDrawListsFn function. Valid after Render() and until the next call to NewFrame()
|
|
|
|
|
|
|
+// Pass this to your backend rendering function! Valid after Render() and until the next call to NewFrame()
|
|
|
ImDrawData* ImGui::GetDrawData()
|
|
ImDrawData* ImGui::GetDrawData()
|
|
|
{
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
@@ -3737,9 +3761,7 @@ void ImGui::NewFrame()
|
|
|
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
|
|
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
|
|
|
|
-#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
|
|
|
- ImGuiTestEngineHook_PreNewFrame(&g);
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_NewFramePre);
|
|
|
|
|
|
|
|
// Check and assert for various common IO and Configuration mistakes
|
|
// Check and assert for various common IO and Configuration mistakes
|
|
|
ErrorCheckNewFrameSanityChecks();
|
|
ErrorCheckNewFrameSanityChecks();
|
|
@@ -3909,9 +3931,7 @@ void ImGui::NewFrame()
|
|
|
Begin("Debug##Default");
|
|
Begin("Debug##Default");
|
|
|
IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true);
|
|
IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true);
|
|
|
|
|
|
|
|
-#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
|
|
|
- ImGuiTestEngineHook_PostNewFrame(&g);
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_NewFramePost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
|
|
// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
|
|
@@ -3996,15 +4016,12 @@ void ImGui::Shutdown(ImGuiContext* context)
|
|
|
if (g.SettingsLoaded && g.IO.IniFilename != NULL)
|
|
if (g.SettingsLoaded && g.IO.IniFilename != NULL)
|
|
|
{
|
|
{
|
|
|
ImGuiContext* backup_context = GImGui;
|
|
ImGuiContext* backup_context = GImGui;
|
|
|
- SetCurrentContext(context);
|
|
|
|
|
|
|
+ SetCurrentContext(&g);
|
|
|
SaveIniSettingsToDisk(g.IO.IniFilename);
|
|
SaveIniSettingsToDisk(g.IO.IniFilename);
|
|
|
SetCurrentContext(backup_context);
|
|
SetCurrentContext(backup_context);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // Notify hooked test engine, if any
|
|
|
|
|
-#ifdef IMGUI_ENABLE_TEST_ENGINE
|
|
|
|
|
- ImGuiTestEngineHook_Shutdown(context);
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_Shutdown);
|
|
|
|
|
|
|
|
// Clear everything else
|
|
// Clear everything else
|
|
|
for (int i = 0; i < g.Windows.Size; i++)
|
|
for (int i = 0; i < g.Windows.Size; i++)
|
|
@@ -4101,11 +4118,11 @@ static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* d
|
|
|
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
|
// - First, make sure you are coarse clipping yourself and not trying to draw many things outside visible bounds.
|
|
|
// Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics window to inspect draw list contents.
|
|
// Be mindful that the ImDrawList API doesn't filter vertices. Use the Metrics window to inspect draw list contents.
|
|
|
// - If you want large meshes with more than 64K vertices, you can either:
|
|
// - If you want large meshes with more than 64K vertices, you can either:
|
|
|
- // (A) Handle the ImDrawCmd::VtxOffset value in your renderer back-end, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
|
|
|
|
|
- // Most example back-ends already support this from 1.71. Pre-1.71 back-ends won't.
|
|
|
|
|
|
|
+ // (A) Handle the ImDrawCmd::VtxOffset value in your renderer backend, and set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset'.
|
|
|
|
|
+ // Most example backends already support this from 1.71. Pre-1.71 backends won't.
|
|
|
// Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
|
|
// Some graphics API such as GL ES 1/2 don't have a way to offset the starting vertex so it is not supported for them.
|
|
|
- // (B) Or handle 32-bit indices in your renderer back-end, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
|
|
|
|
|
- // Most example back-ends already support this. For example, the OpenGL example code detect index size at compile-time:
|
|
|
|
|
|
|
+ // (B) Or handle 32-bit indices in your renderer backend, and uncomment '#define ImDrawIdx unsigned int' line in imconfig.h.
|
|
|
|
|
+ // Most example backends already support this. For example, the OpenGL example code detect index size at compile-time:
|
|
|
// glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
|
|
// glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
|
|
|
// Your own engine or render API may use different parameters or function calls to specify index sizes.
|
|
// Your own engine or render API may use different parameters or function calls to specify index sizes.
|
|
|
// 2 and 4 bytes indices are generally supported by most graphics API.
|
|
// 2 and 4 bytes indices are generally supported by most graphics API.
|
|
@@ -4204,6 +4221,8 @@ void ImGui::EndFrame()
|
|
|
return;
|
|
return;
|
|
|
IM_ASSERT(g.WithinFrameScope && "Forgot to call ImGui::NewFrame()?");
|
|
IM_ASSERT(g.WithinFrameScope && "Forgot to call ImGui::NewFrame()?");
|
|
|
|
|
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_EndFramePre);
|
|
|
|
|
+
|
|
|
ErrorCheckEndFrameSanityChecks();
|
|
ErrorCheckEndFrameSanityChecks();
|
|
|
|
|
|
|
|
// Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
|
|
// Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
|
|
@@ -4270,6 +4289,8 @@ void ImGui::EndFrame()
|
|
|
g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
|
|
g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
|
|
|
g.IO.InputQueueCharacters.resize(0);
|
|
g.IO.InputQueueCharacters.resize(0);
|
|
|
memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs));
|
|
memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs));
|
|
|
|
|
+
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_EndFramePost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void ImGui::Render()
|
|
void ImGui::Render()
|
|
@@ -4283,6 +4304,8 @@ void ImGui::Render()
|
|
|
g.IO.MetricsRenderWindows = 0;
|
|
g.IO.MetricsRenderWindows = 0;
|
|
|
g.DrawDataBuilder.Clear();
|
|
g.DrawDataBuilder.Clear();
|
|
|
|
|
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_RenderPre);
|
|
|
|
|
+
|
|
|
// Add background ImDrawList
|
|
// Add background ImDrawList
|
|
|
if (!g.BackgroundDrawList.VtxBuffer.empty())
|
|
if (!g.BackgroundDrawList.VtxBuffer.empty())
|
|
|
AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.BackgroundDrawList);
|
|
AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.BackgroundDrawList);
|
|
@@ -4315,11 +4338,7 @@ void ImGui::Render()
|
|
|
g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount;
|
|
g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount;
|
|
|
g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
|
|
g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
|
|
|
|
|
|
|
|
- // (Legacy) Call the Render callback function. The current prefer way is to let the user retrieve GetDrawData() and call the render function themselves.
|
|
|
|
|
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
|
|
- if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
|
|
|
|
|
- g.IO.RenderDrawListsFn(&g.DrawData);
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
+ CallContextHooks(&g, ImGuiContextHookType_RenderPost);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
|
|
// Calculate text size. Text can be multi-line. Optionally ignore text after a ## marker.
|
|
@@ -4428,7 +4447,7 @@ int ImGui::GetKeyIndex(ImGuiKey imgui_key)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]!
|
|
// Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]!
|
|
|
-// Use your own indices/enums according to how your back-end/engine stored them into io.KeysDown[]!
|
|
|
|
|
|
|
+// Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]!
|
|
|
bool ImGui::IsKeyDown(int user_key_index)
|
|
bool ImGui::IsKeyDown(int user_key_index)
|
|
|
{
|
|
{
|
|
|
if (user_key_index < 0)
|
|
if (user_key_index < 0)
|
|
@@ -4584,7 +4603,7 @@ bool ImGui::IsAnyMouseDown()
|
|
|
|
|
|
|
|
// Return the delta from the initial clicking position while the mouse button is clicked or was just released.
|
|
// Return the delta from the initial clicking position while the mouse button is clicked or was just released.
|
|
|
// This is locked and return 0.0f until the mouse moves past a distance threshold at least once.
|
|
// This is locked and return 0.0f until the mouse moves past a distance threshold at least once.
|
|
|
-// NB: This is only valid if IsMousePosValid(). Back-ends in theory should always keep mouse position valid when dragging even outside the client window.
|
|
|
|
|
|
|
+// NB: This is only valid if IsMousePosValid(). backends in theory should always keep mouse position valid when dragging even outside the client window.
|
|
|
ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold)
|
|
ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold)
|
|
|
{
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
@@ -6883,7 +6902,7 @@ static void ImGui::ErrorCheckNewFrameSanityChecks()
|
|
|
if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard)
|
|
if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard)
|
|
|
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");
|
|
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");
|
|
|
|
|
|
|
|
- // Perform simple check: the beta io.ConfigWindowsResizeFromEdges option requires back-end to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
|
|
|
|
|
|
|
+ // Perform simple check: the beta io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
|
|
|
if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
|
|
if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
|
|
|
g.IO.ConfigWindowsResizeFromEdges = false;
|
|
g.IO.ConfigWindowsResizeFromEdges = false;
|
|
|
}
|
|
}
|
|
@@ -6893,7 +6912,7 @@ static void ImGui::ErrorCheckEndFrameSanityChecks()
|
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
|
|
|
|
|
|
// Verify that io.KeyXXX fields haven't been tampered with. Key mods should not be modified between NewFrame() and EndFrame()
|
|
// Verify that io.KeyXXX fields haven't been tampered with. Key mods should not be modified between NewFrame() and EndFrame()
|
|
|
- // One possible reason leading to this assert is that your back-ends update inputs _AFTER_ NewFrame().
|
|
|
|
|
|
|
+ // One possible reason leading to this assert is that your backends update inputs _AFTER_ NewFrame().
|
|
|
const ImGuiKeyModFlags expected_key_mod_flags = GetMergedKeyModFlags();
|
|
const ImGuiKeyModFlags expected_key_mod_flags = GetMergedKeyModFlags();
|
|
|
IM_ASSERT(g.IO.KeyMods == expected_key_mod_flags && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
|
|
IM_ASSERT(g.IO.KeyMods == expected_key_mod_flags && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
|
|
|
IM_UNUSED(expected_key_mod_flags);
|
|
IM_UNUSED(expected_key_mod_flags);
|
|
@@ -8558,7 +8577,7 @@ static ImVec2 ImGui::NavCalcPreferredRefPos()
|
|
|
const ImRect& rect_rel = g.NavWindow->NavRectRel[g.NavLayer];
|
|
const ImRect& rect_rel = g.NavWindow->NavRectRel[g.NavLayer];
|
|
|
ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight()));
|
|
ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight()));
|
|
|
ImRect visible_rect = GetViewportRect();
|
|
ImRect visible_rect = GetViewportRect();
|
|
|
- return ImFloor(ImClamp(pos, visible_rect.Min, visible_rect.Max)); // ImFloor() is important because non-integer mouse position application in back-end might be lossy and result in undesirable non-zero delta.
|
|
|
|
|
|
|
+ return ImFloor(ImClamp(pos, visible_rect.Min, visible_rect.Max)); // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta.
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -9200,7 +9219,7 @@ static void ImGui::NavUpdateWindowing()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Keyboard: Press and Release ALT to toggle menu layer
|
|
// Keyboard: Press and Release ALT to toggle menu layer
|
|
|
- // FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of back-end clearing releases all keys on ALT-TAB
|
|
|
|
|
|
|
+ // FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of backend clearing releases all keys on ALT-TAB
|
|
|
if (IsNavInputTest(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Pressed))
|
|
if (IsNavInputTest(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Pressed))
|
|
|
g.NavWindowingToggleLayer = true;
|
|
g.NavWindowingToggleLayer = true;
|
|
|
if ((g.ActiveId == 0 || g.ActiveIdAllowOverlap) && g.NavWindowingToggleLayer && IsNavInputTest(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Released))
|
|
if ((g.ActiveId == 0 || g.ActiveIdAllowOverlap) && g.NavWindowingToggleLayer && IsNavInputTest(ImGuiNavInput_KeyMenu_, ImGuiInputReadMode_Released))
|