mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-21 15:16:35 +00:00
Merge branch 'master' into docking + fix for RenderMouseCursor()
# Conflicts: # docs/CHANGELOG.txt # examples/imgui_impl_opengl3.cpp # imgui.cpp # imgui_draw.cpp # imgui_internal.h
This commit is contained in:
commit
6994bf10bc
@ -99,10 +99,11 @@ Other changes:
|
|||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
VERSION 1.73 WIP (In Progress)
|
VERSION 1.73 (Released 2019-09-24)
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
|
|
||||||
Other Changes:
|
Other Changes:
|
||||||
|
|
||||||
- Nav, Scrolling: Added support for Home/End key. (#787)
|
- Nav, Scrolling: Added support for Home/End key. (#787)
|
||||||
- ColorEdit: Disable Hue edit when Saturation==0 instead of letting Hue values jump around.
|
- ColorEdit: Disable Hue edit when Saturation==0 instead of letting Hue values jump around.
|
||||||
- ColorEdit, ColorPicker: In HSV display of a RGB stored value, attempt to locally preserve Hue
|
- ColorEdit, ColorPicker: In HSV display of a RGB stored value, attempt to locally preserve Hue
|
||||||
@ -110,8 +111,8 @@ Other Changes:
|
|||||||
- ColorPicker: Made rendering aware of global style alpha of the picker can be faded out. (#2711)
|
- ColorPicker: Made rendering aware of global style alpha of the picker can be faded out. (#2711)
|
||||||
Note that some elements won't accurately fade down with the same intensity, and the color wheel
|
Note that some elements won't accurately fade down with the same intensity, and the color wheel
|
||||||
when enabled will have small overlap glitches with (style.Alpha < 1.0).
|
when enabled will have small overlap glitches with (style.Alpha < 1.0).
|
||||||
- TabBar: Fixed ScrollToBar request creating bouncing loop when tab is larger than available space.
|
|
||||||
- TabBar: Fixed single-tab not shrinking their width down.
|
- TabBar: Fixed single-tab not shrinking their width down.
|
||||||
|
- TabBar: Fixed clicking on a tab larger than tab-bar width creating a bouncing feedback loop.
|
||||||
- TabBar: Feed desired width (sum of unclipped tabs width) into layout system to allow for auto-resize. (#2768)
|
- TabBar: Feed desired width (sum of unclipped tabs width) into layout system to allow for auto-resize. (#2768)
|
||||||
(before 1.71 tab bars fed the sum of current width which created feedback loops in certain situations).
|
(before 1.71 tab bars fed the sum of current width which created feedback loops in certain situations).
|
||||||
- TabBar: Improved shrinking for large number of tabs to avoid leaving extraneous space on the right side.
|
- TabBar: Improved shrinking for large number of tabs to avoid leaving extraneous space on the right side.
|
||||||
@ -119,8 +120,8 @@ Other Changes:
|
|||||||
- Columns, Separator: Fixed a bug where non-visible separators within columns would alter the next row position
|
- Columns, Separator: Fixed a bug where non-visible separators within columns would alter the next row position
|
||||||
differently than visible ones.
|
differently than visible ones.
|
||||||
- SliderScalar: Improved assert when using U32 or U64 types with a large v_max value. (#2765) [@loicmouton]
|
- SliderScalar: Improved assert when using U32 or U64 types with a large v_max value. (#2765) [@loicmouton]
|
||||||
- DragInt, DragFloat, DragScalar: Using (v_min > v_max) allows locking any edit to the value.
|
- DragInt, DragFloat, DragScalar: Using (v_min > v_max) allows locking any edits to the value.
|
||||||
- DragScalar: Fixed dragging of unsigned values on ARM cpu. (#2780) [@dBagrat]
|
- DragScalar: Fixed dragging of unsigned values on ARM cpu (float to uint cast is undefined). (#2780) [@dBagrat]
|
||||||
- TreeNode: Added ImGuiTreeNodeFlags_SpanAvailWidth flag. (#2451, #2438, #1897) [@Melix19, @PathogenDavid]
|
- TreeNode: Added ImGuiTreeNodeFlags_SpanAvailWidth flag. (#2451, #2438, #1897) [@Melix19, @PathogenDavid]
|
||||||
This extends the hit-box to the right-most edge, even if the node is not framed.
|
This extends the hit-box to the right-most edge, even if the node is not framed.
|
||||||
(Note: this is not the default in order to allow adding other items on the same line. In the future we will
|
(Note: this is not the default in order to allow adding other items on the same line. In the future we will
|
||||||
@ -128,29 +129,32 @@ Other Changes:
|
|||||||
and then we will be able to make this the default.)
|
and then we will be able to make this the default.)
|
||||||
- TreeNode: Added ImGuiTreeNodeFlags_SpanFullWidth flag. This extends the hit-box to both the left-most and
|
- TreeNode: Added ImGuiTreeNodeFlags_SpanFullWidth flag. This extends the hit-box to both the left-most and
|
||||||
right-most edge of the working area, bypassing indentation.
|
right-most edge of the working area, bypassing indentation.
|
||||||
|
- CollapsingHeader: Added support for ImGuiTreeNodeFlags_Bullet and ImGuiTreeNodeFlags_Leaf on framed nodes,
|
||||||
|
mostly for consistency. (#2159, #2160) [@goran-w]
|
||||||
- Selectable: Added ImGuiSelectableFlags_AllowItemOverlap flag in public api (was previously internal only).
|
- Selectable: Added ImGuiSelectableFlags_AllowItemOverlap flag in public api (was previously internal only).
|
||||||
- Style: Allow style.WindowMenuButtonPosition to be set to ImGuiDir_None to hide the collapse button. (#2634, #2639)
|
- Style: Allow style.WindowMenuButtonPosition to be set to ImGuiDir_None to hide the collapse button. (#2634, #2639)
|
||||||
- Font: Better ellipsis drawing implementation. Instead of drawing three pixel-ey dots (which was glaringly
|
- Font: Better ellipsis ("...") drawing implementation. Instead of drawing three pixel-ey dots (which was glaringly
|
||||||
unfitting with many types of fonts) we first attempt to find a standard ellipsis glyphs within the loaded set.
|
unfitting with many types of fonts) we first attempt to find a standard ellipsis glyphs within the loaded set.
|
||||||
Otherwise we render ellipsis using '.' from the font from where we trim excessive spacing to make it as narrow
|
Otherwise we render ellipsis using '.' from the font from where we trim excessive spacing to make it as narrow
|
||||||
as possible. (#2775) [@rokups]
|
as possible. (#2775) [@rokups]
|
||||||
- ImDrawList: Clarified the name of many parameters so reading the code is a little easier. (#2740)
|
- ImDrawList: Clarified the name of many parameters so reading the code is a little easier. (#2740)
|
||||||
- ImDrawListSplitter: fixed an issue merging channels if the last submitted draw command used a different texture. (#2506)
|
- ImDrawListSplitter: Fixed merging channels if the last submitted draw command used a different texture. (#2506)
|
||||||
- Using offsetof() when available in C++11. Avoids Clang sanitizer complaining about old-style macros. (#94)
|
- Using offsetof() when available in C++11. Avoids Clang sanitizer complaining about old-style macros. (#94)
|
||||||
- ImVector: Added find(), find_erase(), find_erase_unsorted() helpers.
|
- ImVector: Added find(), find_erase(), find_erase_unsorted() helpers.
|
||||||
- Added a mechanism to compact/free the larger allocations of unused windows (buffers are compacted when
|
- Added a mechanism to compact/free the larger allocations of unused windows (buffers are compacted when
|
||||||
a window is unused for 60 seconds, as per io.ConfigWindowsMemoryCompactTimer = 60.0f). Note that memory
|
a window is unused for 60 seconds, as per io.ConfigWindowsMemoryCompactTimer = 60.0f). Note that memory
|
||||||
usage has never been reported as a problem, so this is merely a touch of overzealous luxury. (#2636)
|
usage has never been reported as a problem, so this is merely a touch of overzealous luxury. (#2636)
|
||||||
|
- Documentation: Various tweaks and improvements to the README page. [@ker0chan]
|
||||||
- Backends: OpenGL3: Tweaked initialization code allow application calling ImGui_ImplOpenGL3_CreateFontsTexture()
|
- Backends: OpenGL3: Tweaked initialization code allow application calling ImGui_ImplOpenGL3_CreateFontsTexture()
|
||||||
before ImGui_ImplOpenGL3_NewFrame() if for some reason they wanted.
|
before ImGui_ImplOpenGL3_NewFrame(), which sometimes can be convenient.
|
||||||
- Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count,
|
- Backends: OpenGL3: Attempt to automatically detect default GL loader by using __has_include. (#2798) [@o-micron]
|
||||||
would generally make the debug layer complain (Added in 1.72).
|
- Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count, which would
|
||||||
- Backends: Vulkan: Added support for specifying multisample count.
|
generally make the DX11 debug layer complain (bug added in 1.72).
|
||||||
Set ImGui_ImplVulkan_InitInfo::MSAASamples to one of the VkSampleCountFlagBits values
|
- Backends: Vulkan: Added support for specifying multisample count. Set 'ImGui_ImplVulkan_InitInfo::MSAASamples' to
|
||||||
to use, default is non-multisampled as before. (#2705, #2706) [@vilya]
|
one of the VkSampleCountFlagBits values to use, default is non-multisampled as before. (#2705, #2706) [@vilya]
|
||||||
- Examples: OSX: Fix example_apple_opengl2/main.mm not forwarding mouse clicks and drags correctly. (#1961, #2710)
|
- Examples: OSX: Fix example_apple_opengl2/main.mm not forwarding mouse clicks and drags correctly. (#1961, #2710)
|
||||||
[@intonarumori, @ElectricMagic]
|
[@intonarumori, @ElectricMagic]
|
||||||
- Misc: Updated stb_rect_pack from 0.99 to 1.00 (fixes by @rygorous: off-by-1 bug in best-fit heuristic,
|
- Misc: Updated stb_rect_pack.h from 0.99 to 1.00 (fixes by @rygorous: off-by-1 bug in best-fit heuristic,
|
||||||
fix handling of rectangles too large to fit inside texture). (#2762) [@tido64]
|
fix handling of rectangles too large to fit inside texture). (#2762) [@tido64]
|
||||||
|
|
||||||
|
|
||||||
@ -238,6 +242,7 @@ Other Changes:
|
|||||||
- Demo: Log, Console: Using a simpler stateless pattern for auto-scrolling.
|
- Demo: Log, Console: Using a simpler stateless pattern for auto-scrolling.
|
||||||
- Demo: Widgets: Showing how to use the format parameter of Slider/Drag functions to display the name
|
- Demo: Widgets: Showing how to use the format parameter of Slider/Drag functions to display the name
|
||||||
of an enum value instead of the underlying integer value.
|
of an enum value instead of the underlying integer value.
|
||||||
|
- Demo: Renamed the "Help" menu to "Tools" (more accurate).
|
||||||
- Backends: DX10/DX11: Backup, clear and restore Geometry Shader is any is bound when calling renderer.
|
- Backends: DX10/DX11: Backup, clear and restore Geometry Shader is any is bound when calling renderer.
|
||||||
- Backends: DX11: Clear Hull Shader, Domain Shader, Compute Shader before rendering. Not backing/restoring them.
|
- Backends: DX11: Clear Hull Shader, Domain Shader, Compute Shader before rendering. Not backing/restoring them.
|
||||||
- Backends: OSX: Disabled default native Mac clipboard copy/paste implementation in core library (added in 1.71),
|
- Backends: OSX: Disabled default native Mac clipboard copy/paste implementation in core library (added in 1.71),
|
||||||
|
@ -3,9 +3,9 @@ dear imgui
|
|||||||
[![Build Status](https://api.travis-ci.com/ocornut/imgui.svg?branch=master)](https://travis-ci.com/ocornut/imgui)
|
[![Build Status](https://api.travis-ci.com/ocornut/imgui.svg?branch=master)](https://travis-ci.com/ocornut/imgui)
|
||||||
[![Coverity Status](https://scan.coverity.com/projects/4720/badge.svg)](https://scan.coverity.com/projects/4720)
|
[![Coverity Status](https://scan.coverity.com/projects/4720/badge.svg)](https://scan.coverity.com/projects/4720)
|
||||||
|
|
||||||
_(This library is available under a free and permissive licence, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal.)_
|
<sub>(This library is available under a free and permissive licence, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal.)</sub>
|
||||||
|
|
||||||
Businesses: support continued development via invoiced technical support & maintenance contracts:
|
Businesses: support continued development via invoiced technical support, maintenance, sponsoring contracts:
|
||||||
<br> _E-mail: omarcornut at gmail dot com_
|
<br> _E-mail: omarcornut at gmail dot com_
|
||||||
|
|
||||||
Individuals/hobbyists: support continued maintenance and development via the monthly Patreon:
|
Individuals/hobbyists: support continued maintenance and development via the monthly Patreon:
|
||||||
@ -14,14 +14,23 @@ Individuals/hobbyists: support continued maintenance and development via the mon
|
|||||||
Individuals/hobbyists: support continued maintenance and development via PayPal:
|
Individuals/hobbyists: support continued maintenance and development via PayPal:
|
||||||
<br> [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S)
|
<br> [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S)
|
||||||
|
|
||||||
Dear ImGui is a bloat-free graphical user interface library for C++. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).
|
----
|
||||||
|
|
||||||
Dear ImGui is designed to enable fast iterations and to empower programmers to create content creation tools and visualization / debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and lacks certain features normally found in more high-level libraries.
|
Dear ImGui is a **bloat-free graphical user interface library for C++**. It outputs optimized vertex buffers that you can render anytime in your 3D-pipeline enabled application. It is fast, portable, renderer agnostic and self-contained (no external dependencies).
|
||||||
|
|
||||||
|
Dear ImGui is designed to **enable fast iterations** and to **empower programmers** to create **content creation tools and visualization / debug tools** (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and lacks certain features normally found in more high-level libraries.
|
||||||
|
|
||||||
Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.
|
Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.
|
||||||
|
|
||||||
See [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui), [Quotes](https://github.com/ocornut/imgui/wiki/Quotes) and [Gallery](https://github.com/ocornut/imgui/issues/2529) pages to get an idea of its use cases.
|
See [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui), [Quotes](https://github.com/ocornut/imgui/wiki/Quotes) and [Gallery](https://github.com/ocornut/imgui/issues/2529) pages to get an idea of its use cases.
|
||||||
|
|
||||||
|
| [Usage](#usage) - [How it works](#how-it-works) - [Demo](#demo) - [Integration](#integration) |
|
||||||
|
:----------------------------------------------------------: |
|
||||||
|
| [Upcoming changes](#upcoming-changes) - [Gallery](#gallery) - [Support, FAQ](#support-frequently-asked-questions-faq) - [How to help](#how-to-help) - [Sponsors](#sponsors) - [Credits](#credits) - [License](#license) |
|
||||||
|
| <sub>[Wiki](https://github.com/ocornut/imgui/wiki) - [Language & frameworks bindings](https://github.com/ocornut/imgui/wiki/Bindings) - [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) - [Quotes](https://github.com/ocornut/imgui/wiki/Quotes) </sub> |
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
|
||||||
Dear ImGui is self-contained within a few files that you can easily copy and compile into your application/engine:
|
Dear ImGui is self-contained within a few files that you can easily copy and compile into your application/engine:
|
||||||
- imgui.cpp
|
- imgui.cpp
|
||||||
- imgui.h
|
- imgui.h
|
||||||
@ -36,12 +45,12 @@ Dear ImGui is self-contained within a few files that you can easily copy and com
|
|||||||
|
|
||||||
No specific build process is required. You can add the .cpp files to your project or #include them from an existing file.
|
No specific build process is required. You can add the .cpp files to your project or #include them from an existing file.
|
||||||
|
|
||||||
### Usage
|
Backends for a variety of graphics api and rendering platforms are provided in the [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder.
|
||||||
|
|
||||||
Your code passes mouse/keyboard/gamepad inputs and settings to Dear ImGui (see example applications for more details). After Dear ImGui is setup, you can use it from \_anywhere\_ in your program loop:
|
The backend passes mouse/keyboard/gamepad inputs and variety of settings to Dear ImGui, and is in charge of rendering the resulting vertices (see example applications for more details). After Dear ImGui is setup in your application, you can use it from \_anywhere\_ in your program loop:
|
||||||
|
|
||||||
Code:
|
Code:
|
||||||
```cpp
|
```cp
|
||||||
ImGui::Text("Hello, world %d", 123);
|
ImGui::Text("Hello, world %d", 123);
|
||||||
if (ImGui::Button("Save"))
|
if (ImGui::Button("Save"))
|
||||||
{
|
{
|
||||||
@ -88,6 +97,8 @@ ImGui::End();
|
|||||||
Result:
|
Result:
|
||||||
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_03_color.gif)
|
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_03_color.gif)
|
||||||
|
|
||||||
|
Dear ImGui allows you **create elaborate tools** as well as very short-lived ones. On the extreme side of short-liveness: using the Edit&Continue (hot code reload) feature of modern compilers you can add a few widgets to tweaks variables while your application is running, and remove the code a minute later! Dear ImGui is not just for tweaking values. You can use it to trace a running algorithm by just emitting text commands. You can use it along with your own reflection data to browse your dataset live. You can use it to expose the internals of a subsystem in your engine, to create a logger, an inspection tool, a profiler, a debugger, an entire game making editor/framework, etc.
|
||||||
|
|
||||||
### How it works
|
### How it works
|
||||||
|
|
||||||
Check out the References section if you want to understand the core principles behind the IMGUI paradigm. An IMGUI tries to minimize superfluous state duplication, state synchronization and state retention from the user's point of view. It is less error prone (less code and less bugs) than traditional retained-mode interfaces, and lends itself to create dynamic user interfaces.
|
Check out the References section if you want to understand the core principles behind the IMGUI paradigm. An IMGUI tries to minimize superfluous state duplication, state synchronization and state retention from the user's point of view. It is less error prone (less code and less bugs) than traditional retained-mode interfaces, and lends itself to create dynamic user interfaces.
|
||||||
@ -96,18 +107,18 @@ Dear ImGui outputs vertex buffers and command lists that you can easily render i
|
|||||||
|
|
||||||
_A common misunderstanding is to mistake immediate mode gui for immediate mode rendering, which usually implies hammering your driver/GPU with a bunch of inefficient draw calls and state changes as the gui functions are called. This is NOT what Dear ImGui does. Dear ImGui outputs vertex buffers and a small list of draw calls batches. It never touches your GPU directly. The draw call batches are decently optimal and you can render them later, in your app or even remotely._
|
_A common misunderstanding is to mistake immediate mode gui for immediate mode rendering, which usually implies hammering your driver/GPU with a bunch of inefficient draw calls and state changes as the gui functions are called. This is NOT what Dear ImGui does. Dear ImGui outputs vertex buffers and a small list of draw calls batches. It never touches your GPU directly. The draw call batches are decently optimal and you can render them later, in your app or even remotely._
|
||||||
|
|
||||||
Dear ImGui allows you create elaborate tools as well as very short-lived ones. On the extreme side of short-liveness: using the Edit&Continue (hot code reload) feature of modern compilers you can add a few widgets to tweaks variables while your application is running, and remove the code a minute later! Dear ImGui is not just for tweaking values. You can use it to trace a running algorithm by just emitting text commands. You can use it along with your own reflection data to browse your dataset live. You can use it to expose the internals of a subsystem in your engine, to create a logger, an inspection tool, a profiler, a debugger, an entire game making editor/framework, etc.
|
### Demo
|
||||||
|
|
||||||
Demo Binaries
|
Calling the `ImGui::ShowDemoWindow()` function will create a demo window showcasing variety of Dear ImGui features and examples.
|
||||||
-------------
|
|
||||||
|
![screenshot demo](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/v167-misc.png)
|
||||||
|
|
||||||
You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let me know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here:
|
You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let me know! If you want to have a quick look at some Dear ImGui features, you can download Windows binaries of the demo app here:
|
||||||
- [imgui-demo-binaries-20190715.zip](http://www.dearimgui.org/binaries/imgui-demo-binaries-20190715.zip) (Windows binaries, Dear ImGui 1.72 WIP built 2019/07/15, master branch, 5 executables)
|
- [imgui-demo-binaries-20190715.zip](http://www.dearimgui.org/binaries/imgui-demo-binaries-20190715.zip) (Windows binaries, Dear ImGui 1.72 WIP built 2019/07/15, master branch, 5 executables)
|
||||||
|
|
||||||
The demo applications are unfortunately not yet DPI aware so expect some blurriness on a 4K screen. For DPI awareness in your application, you can load/reload your font at different scale, and scale your Style with `style.ScaleAllSizes()`.
|
The demo applications are unfortunately not yet DPI aware so expect some blurriness on a 4K screen. For DPI awareness in your application, you can load/reload your font at different scale, and scale your Style with `style.ScaleAllSizes()`.
|
||||||
|
|
||||||
Bindings
|
### Integration
|
||||||
--------
|
|
||||||
|
|
||||||
Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading one texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles. The [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder is populated with applications doing just that. If you are an experienced programmer at ease with those concepts, it should take you about an hour to integrate Dear ImGui in your custom engine. Make sure to spend time reading the FAQ, the comments and other documentation!
|
Integrating Dear ImGui within your custom engine is a matter of 1) wiring mouse/keyboard/gamepad inputs 2) uploading one texture to your GPU/render engine 3) providing a render function that can bind textures and render textured triangles. The [examples/](https://github.com/ocornut/imgui/tree/master/examples) folder is populated with applications doing just that. If you are an experienced programmer at ease with those concepts, it should take you about an hour to integrate Dear ImGui in your custom engine. Make sure to spend time reading the FAQ, the comments and other documentation!
|
||||||
|
|
||||||
@ -158,8 +169,8 @@ Frameworks:
|
|||||||
|
|
||||||
For other bindings: see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings/). Also see [Wiki](https://github.com/ocornut/imgui/wiki) for more links and ideas.
|
For other bindings: see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings/). Also see [Wiki](https://github.com/ocornut/imgui/wiki) for more links and ideas.
|
||||||
|
|
||||||
Roadmap
|
### Upcoming Changes
|
||||||
-------
|
|
||||||
Some of the goals for 2019 are:
|
Some of the goals for 2019 are:
|
||||||
- Finish work on docking, tabs. (see [#2109](https://github.com/ocornut/imgui/issues/2109), in public `docking` branch looking for feedback)
|
- Finish work on docking, tabs. (see [#2109](https://github.com/ocornut/imgui/issues/2109), in public `docking` branch looking for feedback)
|
||||||
- Finish work on multiple viewports / multiple OS windows. (see [#1542](https://github.com/ocornut/imgui/issues/1542), in public `docking` branch looking for feedback)
|
- Finish work on multiple viewports / multiple OS windows. (see [#1542](https://github.com/ocornut/imgui/issues/1542), in public `docking` branch looking for feedback)
|
||||||
@ -168,18 +179,9 @@ Some of the goals for 2019 are:
|
|||||||
- Make Columns better. (they are currently pretty terrible!)
|
- Make Columns better. (they are currently pretty terrible!)
|
||||||
- Make the examples look better, improve styles, improve font support, make the examples hi-DPI aware.
|
- Make the examples look better, improve styles, improve font support, make the examples hi-DPI aware.
|
||||||
|
|
||||||
Gallery
|
### Gallery
|
||||||
-------
|
|
||||||
User screenshots:
|
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/2529)!
|
||||||
<br>[Gallery Part 1](https://github.com/ocornut/imgui/issues/123) (Feb 2015 to Feb 2016)
|
|
||||||
<br>[Gallery Part 2](https://github.com/ocornut/imgui/issues/539) (Feb 2016 to Aug 2016)
|
|
||||||
<br>[Gallery Part 3](https://github.com/ocornut/imgui/issues/772) (Aug 2016 to Jan 2017)
|
|
||||||
<br>[Gallery Part 4](https://github.com/ocornut/imgui/issues/973) (Jan 2017 to Aug 2017)
|
|
||||||
<br>[Gallery Part 5](https://github.com/ocornut/imgui/issues/1269) (Aug 2017 to Feb 2018)
|
|
||||||
<br>[Gallery Part 6](https://github.com/ocornut/imgui/issues/1607) (Feb 2018 to June 2018)
|
|
||||||
<br>[Gallery Part 7](https://github.com/ocornut/imgui/issues/1902) (June 2018 to January 2019)
|
|
||||||
<br>[Gallery Part 8](https://github.com/ocornut/imgui/issues/2265) (January 2019 to May 2019)
|
|
||||||
<br>[Gallery Part 9](https://github.com/ocornut/imgui/issues/2529) (May 2019 onward)
|
|
||||||
|
|
||||||
Custom engine
|
Custom engine
|
||||||
[![screenshot game](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v149/gallery_TheDragonsTrap-01-thumb.jpg)](https://cloud.githubusercontent.com/assets/8225057/20628927/33e14cac-b329-11e6-80f6-9524e93b048a.png)
|
[![screenshot game](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v149/gallery_TheDragonsTrap-01-thumb.jpg)](https://cloud.githubusercontent.com/assets/8225057/20628927/33e14cac-b329-11e6-80f6-9524e93b048a.png)
|
||||||
@ -187,14 +189,10 @@ Custom engine
|
|||||||
Custom engine
|
Custom engine
|
||||||
[![screenshot tool](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white_preview.jpg)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white.png)
|
[![screenshot tool](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white_preview.jpg)](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/editor_white.png)
|
||||||
|
|
||||||
Demo window
|
|
||||||
![screenshot demo](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/v167-misc.png)
|
|
||||||
|
|
||||||
[Tracy Profiler](https://bitbucket.org/wolfpld/tracy)
|
[Tracy Profiler](https://bitbucket.org/wolfpld/tracy)
|
||||||
![tracy profiler](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/tracy_profiler.png)
|
![tracy profiler](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v167/tracy_profiler.png)
|
||||||
|
|
||||||
References
|
### References
|
||||||
----------
|
|
||||||
|
|
||||||
The Immediate Mode GUI paradigm may at first appear unusual to some users. This is mainly because "Retained Mode" GUIs have been so widespread and predominant. The following links can give you a better understanding about how Immediate Mode GUIs works.
|
The Immediate Mode GUI paradigm may at first appear unusual to some users. This is mainly because "Retained Mode" GUIs have been so widespread and predominant. The following links can give you a better understanding about how Immediate Mode GUIs works.
|
||||||
- [Johannes 'johno' Norneby's article](http://www.johno.se/book/imgui.html).
|
- [Johannes 'johno' Norneby's article](http://www.johno.se/book/imgui.html).
|
||||||
@ -206,18 +204,14 @@ The Immediate Mode GUI paradigm may at first appear unusual to some users. This
|
|||||||
|
|
||||||
See the [Wiki](https://github.com/ocornut/imgui/wiki) for more references and [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for third-party bindings to different languages and frameworks.
|
See the [Wiki](https://github.com/ocornut/imgui/wiki) for more references and [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for third-party bindings to different languages and frameworks.
|
||||||
|
|
||||||
Support
|
### Support, Frequently Asked Questions (FAQ)
|
||||||
-------
|
|
||||||
|
|
||||||
If you are new to Dear ImGui and have issues with: compiling, linking, adding fonts, wiring inputs, running or displaying Dear ImGui: please post on the Discourse forums: https://discourse.dearimgui.org.
|
If you are new to Dear ImGui and have issues with: compiling, linking, adding fonts, wiring inputs, running or displaying Dear ImGui: you can use [Discord server](https://discord.gg/NgJ4SEP) or [Discourse forums](https://discourse.dearimgui.org).
|
||||||
|
|
||||||
Otherwise for any other questions, bug reports, requests, feedback, you may post on https://github.com/ocornut/imgui/issues. Please read and fill the New Issue template carefully.
|
Otherwise for any other questions, bug reports, requests, feedback, you may post on https://github.com/ocornut/imgui/issues. Please read and fill the New Issue template carefully.
|
||||||
|
|
||||||
Private support is available for paying customers.
|
Private support is available for paying customers.
|
||||||
|
|
||||||
Frequently Asked Question (FAQ)
|
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
**Where is the documentation?**
|
**Where is the documentation?**
|
||||||
|
|
||||||
This library is poorly documented at the moment and expects of the user to be acquainted with C/C++.
|
This library is poorly documented at the moment and expects of the user to be acquainted with C/C++.
|
||||||
@ -278,12 +272,12 @@ Dear ImGui takes advantage of a few C++ languages features for convenience but n
|
|||||||
|
|
||||||
There is an auto-generated [c-api for Dear ImGui (cimgui)](https://github.com/cimgui/cimgui) by Sonoro1234 and Stephan Dilly. It is designed for creating binding to other languages. If possible, I would suggest using your target language functionalities to try replicating the function overloading and default parameters used in C++ else the API may be harder to use. Also see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for various third-party bindings.
|
There is an auto-generated [c-api for Dear ImGui (cimgui)](https://github.com/cimgui/cimgui) by Sonoro1234 and Stephan Dilly. It is designed for creating binding to other languages. If possible, I would suggest using your target language functionalities to try replicating the function overloading and default parameters used in C++ else the API may be harder to use. Also see [Bindings](https://github.com/ocornut/imgui/wiki/Bindings) for various third-party bindings.
|
||||||
|
|
||||||
Support dear imgui
|
How to help
|
||||||
------------------
|
-----------
|
||||||
|
|
||||||
**How can I help?**
|
**How can I help?**
|
||||||
|
|
||||||
- You may participate in the [Discourse forums](https://discourse.dearimgui.org) and the GitHub [issues tracker](https://github.com/ocornut/imgui/issues).
|
- You may participate in the [Discord server](https://discord.gg/NgJ4SEP), [Discourse forums](https://discourse.dearimgui.org), GitHub [issues tracker](https://github.com/ocornut/imgui/issues).
|
||||||
- You may help with development and submit pull requests! Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance forever. PR should be crafted both in the interest in the end-users and also to ease the maintainer into understanding and accepting it.
|
- You may help with development and submit pull requests! Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance forever. PR should be crafted both in the interest in the end-users and also to ease the maintainer into understanding and accepting it.
|
||||||
- See [Help wanted](https://github.com/ocornut/imgui/wiki/Help-Wanted) on the [Wiki](https://github.com/ocornut/imgui/wiki/) for some more ideas.
|
- See [Help wanted](https://github.com/ocornut/imgui/wiki/Help-Wanted) on the [Wiki](https://github.com/ocornut/imgui/wiki/) for some more ideas.
|
||||||
- Have your company financially support this project.
|
- Have your company financially support this project.
|
||||||
@ -292,7 +286,7 @@ Support dear imgui
|
|||||||
|
|
||||||
Your contributions are keeping this project alive. The library is available under a free and permissive licence, but continued maintenance and development are a full-time endeavor and I would like to grow the team. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out for invoiced technical support and maintenance contracts. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal. Thank you!
|
Your contributions are keeping this project alive. The library is available under a free and permissive licence, but continued maintenance and development are a full-time endeavor and I would like to grow the team. In addition to maintenance and stability there are many desirable features yet to be added. If your company is using dear imgui, please consider reaching out for invoiced technical support and maintenance contracts. If you are an individual using dear imgui, please consider supporting the project via Patreon or PayPal. Thank you!
|
||||||
|
|
||||||
Businesses: support continued development via invoiced technical support & maintenance contracts:
|
Businesses: support continued development via invoiced technical support, maintenance, sponsoring contracts:
|
||||||
<br> _E-mail: omarcornut at gmail dot com_
|
<br> _E-mail: omarcornut at gmail dot com_
|
||||||
|
|
||||||
Individuals/hobbyists: support continued maintenance and development via the monthly Patreon:
|
Individuals/hobbyists: support continued maintenance and development via the monthly Patreon:
|
||||||
@ -301,20 +295,22 @@ Individuals/hobbyists: support continued maintenance and development via the mon
|
|||||||
Individuals/hobbyists: support continued maintenance and development via PayPal:
|
Individuals/hobbyists: support continued maintenance and development via PayPal:
|
||||||
<br> [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S)
|
<br> [![PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WGHNC6MBFLZ2S)
|
||||||
|
|
||||||
Ongoing dear imgui development is financially supported by users and private sponsors, recently:
|
### Sponsors
|
||||||
|
|
||||||
**Platinum-chocolate sponsors**
|
Ongoing Dear ImGui development is financially supported by users and private sponsors, recently:
|
||||||
|
|
||||||
|
*Platinum-chocolate sponsors*
|
||||||
- Blizzard Entertainment
|
- Blizzard Entertainment
|
||||||
- Google
|
- Google
|
||||||
|
|
||||||
**Double-chocolate sponsors**
|
*Double-chocolate sponsors*
|
||||||
- Media Molecule, Mobigame, Aras Pranckevičius, Greggman, DotEmu, Nadeo, Supercell, Runner, Aiden Koss, Kylotonn.
|
- Media Molecule, Mobigame, Aras Pranckevičius, Greggman, DotEmu, Nadeo, Supercell, Runner, Aiden Koss, Kylotonn.
|
||||||
|
|
||||||
**Salty caramel supporters**
|
*Salty caramel supporters*
|
||||||
- Remedy Entertainment, Recognition Robotics, ikrima, Geoffrey Evans, Mercury Labs, Singularity Demo Group, Lionel Landwerlin, Ron Gilbert, Brandon Townsend, G3DVu, Cort Stratton, drudru, Harfang 3D, Jeff Roberts, Rainway inc, Ondra Voves, Mesh Consultants, Unit 2 Games, Neil Bickford, Bill Six, Graham Manders.
|
- Remedy Entertainment, Recognition Robotics, ikrima, Geoffrey Evans, Mercury Labs, Singularity Demo Group, Lionel Landwerlin, Ron Gilbert, Brandon Townsend, G3DVu, Cort Stratton, drudru, Harfang 3D, Jeff Roberts, Rainway inc, Ondra Voves, Mesh Consultants, Unit 2 Games, Neil Bickford, Bill Six, Graham Manders.
|
||||||
|
|
||||||
**Caramel supporters**
|
*Caramel supporters*
|
||||||
- Jerome Lanquetot, Daniel Collin, Ctrl Alt Ninja, Neil Henning, Neil Blakey-Milner, Aleksei, NeiloGD, Eric, Game Atelier, Vincent Hamm, Morten Skaaning, Colin Riley, Sergio Gonzales, Andrew Berridge, Roy Eltham, Game Preservation Society, Josh Faust, Martin Donlon, Codecat, Doug McNabb, Emmanuel Julien, Guillaume Chereau, Jeffrey Slutter, Jeremiah Deckard, r-lyeh, Nekith, Joshua Fisher, Malte Hoffmann, Mustafa Karaalioglu, Merlyn Morgan-Graham, Per Vognsen, Fabian Giesen, Jan Staubach, Matt Hargett, John Shearer, Jesse Chounard, kingcoopa, Jonas Bernemann, Johan Andersson, Michael Labbe, Tomasz Golebiowski, Louis Schnellbach, Jimmy Andrews, Bojan Endrovski, Robin Berg Pettersen, Rachel Crawford, Andrew Johnson, Sean Hunter, Jordan Mellow, Nefarius Software Solutions, Laura Wieme, Robert Nix, Mick Honey, Steven Kah Hien Wong, Bartosz Bielecki, Oscar Penas, A M, Liam Moynihan, Artometa, Mark Lee, Dimitri Diakopoulos, Pete Goodwin, Johnathan Roatch, nyu lea, Oswald Hurlem, Semyon Smelyanskiy, Le Bach, Jeong MyeongSoo, Chris Matthews, Astrofra, Frederik De Bleser, Anticrisis.
|
- Jerome Lanquetot, Daniel Collin, Ctrl Alt Ninja, Neil Henning, Neil Blakey-Milner, Aleksei, NeiloGD, Eric, Game Atelier, Vincent Hamm, Morten Skaaning, Colin Riley, Sergio Gonzales, Andrew Berridge, Roy Eltham, Game Preservation Society, Josh Faust, Martin Donlon, Codecat, Doug McNabb, Emmanuel Julien, Guillaume Chereau, Jeffrey Slutter, Jeremiah Deckard, r-lyeh, Nekith, Joshua Fisher, Malte Hoffmann, Mustafa Karaalioglu, Merlyn Morgan-Graham, Per Vognsen, Fabian Giesen, Jan Staubach, Matt Hargett, John Shearer, Jesse Chounard, kingcoopa, Jonas Bernemann, Johan Andersson, Michael Labbe, Tomasz Golebiowski, Louis Schnellbach, Jimmy Andrews, Bojan Endrovski, Robin Berg Pettersen, Rachel Crawford, Andrew Johnson, Sean Hunter, Jordan Mellow, Nefarius Software Solutions, Laura Wieme, Robert Nix, Mick Honey, Steven Kah Hien Wong, Bartosz Bielecki, Oscar Penas, A M, Liam Moynihan, Artometa, Mark Lee, Dimitri Diakopoulos, Pete Goodwin, Johnathan Roatch, nyu lea, Oswald Hurlem, Semyon Smelyanskiy, Le Bach, Jeong MyeongSoo, Chris Matthews, Astrofra, Frederik De Bleser, Anticrisis, Matt Reyer.
|
||||||
|
|
||||||
And all other past and present supporters; THANK YOU!
|
And all other past and present supporters; THANK YOU!
|
||||||
(Please contact me if you would like to be added or removed from this list)
|
(Please contact me if you would like to be added or removed from this list)
|
||||||
|
@ -63,7 +63,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
|
|||||||
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc. (#395)
|
- widgets: display mode: widget-label, label-widget (aligned on column or using fixed size), label-newline-tab-widget etc. (#395)
|
||||||
- widgets: clean up widgets internal toward exposing everything and stabilizing imgui_internals.h.
|
- widgets: clean up widgets internal toward exposing everything and stabilizing imgui_internals.h.
|
||||||
- widgets: add visuals for Disabled/ReadOnly mode and expose publicly (#211)
|
- widgets: add visuals for Disabled/ReadOnly mode and expose publicly (#211)
|
||||||
- widgets: add always-allow-overlap mode. This should perhaps be the default.
|
- widgets: add always-allow-overlap mode. This should perhaps be the default? one problem is that highlight after mouse-wheel scrolling gets deferred, makes scrolling more flickery.
|
||||||
- widgets: start exposing PushItemFlag() and ImGuiItemFlags
|
- widgets: start exposing PushItemFlag() and ImGuiItemFlags
|
||||||
- widgets: alignment options in style (e.g. center Selectable, Right-Align within Button, etc.) #1260
|
- widgets: alignment options in style (e.g. center Selectable, Right-Align within Button, etc.) #1260
|
||||||
- widgets: activate by identifier (trigger button, focus given id)
|
- widgets: activate by identifier (trigger button, focus given id)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
dear imgui, v1.73 WIP
|
dear imgui, v1.73
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
examples/README.txt
|
examples/README.txt
|
||||||
(This is the README file for the examples/ folder. See docs/ for more documentation)
|
(This is the README file for the examples/ folder. See docs/ for more documentation)
|
||||||
|
@ -7,9 +7,10 @@
|
|||||||
#include "imgui_impl_opengl3.h"
|
#include "imgui_impl_opengl3.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
// About OpenGL function loaders: modern OpenGL doesn't have a standard header file and requires individual function pointers to be loaded manually.
|
// About Desktop OpenGL function loaders:
|
||||||
// Helper libraries are often used for this purpose! Here we are supporting a few common ones: gl3w, glew, glad.
|
// Modern desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers.
|
||||||
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
|
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
|
||||||
|
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
|
||||||
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
||||||
#include <GL/gl3w.h> // Initialize with gl3wInit()
|
#include <GL/gl3w.h> // Initialize with gl3wInit()
|
||||||
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
|
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
|
|
||||||
// About OpenGL function loaders: modern OpenGL doesn't have a standard header file and requires individual function pointers to be loaded manually.
|
// About Desktop OpenGL function loaders:
|
||||||
// Helper libraries are often used for this purpose! Here we are supporting a few common ones: gl3w, glew, glad.
|
// Modern desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers.
|
||||||
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
|
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
|
||||||
|
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
|
||||||
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
||||||
#include <GL/gl3w.h> // Initialize with gl3wInit()
|
#include <GL/gl3w.h> // Initialize with gl3wInit()
|
||||||
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
|
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline
|
// dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline
|
||||||
// - Desktop GL: 3.x 4.x
|
// - Desktop GL: 2.x 3.x 4.x
|
||||||
// - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
|
// - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
|
||||||
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
|
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
|
||||||
|
|
||||||
@ -15,6 +15,7 @@
|
|||||||
// CHANGELOG
|
// CHANGELOG
|
||||||
// (minor and older changes stripped away, please see git history for details)
|
// (minor and older changes stripped away, please see git history for details)
|
||||||
// 2019-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
|
// 2019-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
|
||||||
|
// 2019-09-22: OpenGL: Detect default GL loader using __has_include compiler facility.
|
||||||
// 2019-09-16: OpenGL: Tweak initialization code to allow application calling ImGui_ImplOpenGL3_CreateFontsTexture() before the first NewFrame() call.
|
// 2019-09-16: OpenGL: Tweak initialization code to allow application calling ImGui_ImplOpenGL3_CreateFontsTexture() before the first NewFrame() call.
|
||||||
// 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
|
// 2019-05-29: OpenGL: Desktop GL only: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag.
|
||||||
// 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
|
// 2019-04-30: OpenGL: Added support for special ImDrawCallback_ResetRenderState callback to reset render state.
|
||||||
@ -81,12 +82,21 @@
|
|||||||
// Auto-detect GL version
|
// Auto-detect GL version
|
||||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3)
|
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3)
|
||||||
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__))
|
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__))
|
||||||
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
|
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_GL3W
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_GLEW
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_GLAD
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_CUSTOM
|
||||||
#elif defined(__EMSCRIPTEN__)
|
#elif defined(__EMSCRIPTEN__)
|
||||||
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
|
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_GL3W
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_GLEW
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_GLAD
|
||||||
|
#undef IMGUI_IMPL_OPENGL_LOADER_CUSTOM
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// GL includes
|
||||||
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
||||||
#include <GLES2/gl2.h>
|
#include <GLES2/gl2.h>
|
||||||
#elif defined(IMGUI_IMPL_OPENGL_ES3)
|
#elif defined(IMGUI_IMPL_OPENGL_ES3)
|
||||||
@ -156,6 +166,23 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
|
|||||||
strcpy(g_GlslVersionString, glsl_version);
|
strcpy(g_GlslVersionString, glsl_version);
|
||||||
strcat(g_GlslVersionString, "\n");
|
strcat(g_GlslVersionString, "\n");
|
||||||
|
|
||||||
|
// Dummy construct to make it easily visible in the IDE and debugger which GL loader has been selected.
|
||||||
|
// The code actually never uses the 'gl_loader' variable! It is only here so you can read it!
|
||||||
|
// If auto-detection fails or doesn't select the same GL loader file as used by your application,
|
||||||
|
// you are likely to get a crash below.
|
||||||
|
// You can explicitly select a loader by using '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line.
|
||||||
|
const char* gl_loader = "Unknown";
|
||||||
|
IM_UNUSED(gl_loader);
|
||||||
|
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
||||||
|
gl_loader = "GL3W";
|
||||||
|
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
|
||||||
|
gl_loader = "GLEW";
|
||||||
|
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
|
||||||
|
gl_loader = "GLAD";
|
||||||
|
#else IMGUI_IMPL_OPENGL_LOADER_CUSTOM
|
||||||
|
gl_loader = "Custom";
|
||||||
|
#endif
|
||||||
|
|
||||||
// Make a dummy GL call (we don't actually need the result)
|
// Make a dummy GL call (we don't actually need the result)
|
||||||
// IF YOU GET A CRASH HERE: it probably means that you haven't initialized the OpenGL function loader used by this code.
|
// IF YOU GET A CRASH HERE: it probably means that you haven't initialized the OpenGL function loader used by this code.
|
||||||
// Desktop OpenGL 3/4 need a function loader. See the IMGUI_IMPL_OPENGL_LOADER_xxx explanation above.
|
// Desktop OpenGL 3/4 need a function loader. See the IMGUI_IMPL_OPENGL_LOADER_xxx explanation above.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline
|
// dear imgui: Renderer for modern OpenGL with shaders / programmatic pipeline
|
||||||
// - Desktop GL: 3.x 4.x
|
// - Desktop GL: 2.x 3.x 4.x
|
||||||
// - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
|
// - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
|
||||||
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
|
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
|
||||||
|
|
||||||
@ -24,25 +24,42 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// Specific OpenGL versions
|
// Backend API
|
||||||
//#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten
|
|
||||||
//#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android
|
|
||||||
|
|
||||||
// Set default OpenGL3 loader to be gl3w
|
|
||||||
#if !defined(IMGUI_IMPL_OPENGL_LOADER_GL3W) \
|
|
||||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLEW) \
|
|
||||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) \
|
|
||||||
&& !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
|
|
||||||
#define IMGUI_IMPL_OPENGL_LOADER_GL3W
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL);
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
|
||||||
|
|
||||||
// Called by Init/NewFrame/Shutdown
|
// (Optional) Called by Init/NewFrame/Shutdown
|
||||||
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture();
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture();
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture();
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture();
|
||||||
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
|
||||||
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
||||||
|
|
||||||
|
// Specific OpenGL versions
|
||||||
|
//#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten
|
||||||
|
//#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android
|
||||||
|
|
||||||
|
// Desktop OpenGL: attempt to detect default GL loader based on available header files.
|
||||||
|
// If auto-detection fails or doesn't select the same GL loader file as used by your application,
|
||||||
|
// you are likely to get a crash in ImGui_ImplOpenGL3_Init().
|
||||||
|
// You can explicitly select a loader by using '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line.
|
||||||
|
#if !defined(IMGUI_IMPL_OPENGL_LOADER_GL3W) \
|
||||||
|
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLEW) \
|
||||||
|
&& !defined(IMGUI_IMPL_OPENGL_LOADER_GLAD) \
|
||||||
|
&& !defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
|
||||||
|
#if defined(__has_include)
|
||||||
|
#if __has_include(<GL/glew.h>)
|
||||||
|
#define IMGUI_IMPL_OPENGL_LOADER_GLEW
|
||||||
|
#elif __has_include(<glad/glad.h>)
|
||||||
|
#define IMGUI_IMPL_OPENGL_LOADER_GLAD
|
||||||
|
#elif __has_include(<GL/gl3w.h>)
|
||||||
|
#define IMGUI_IMPL_OPENGL_LOADER_GL3W
|
||||||
|
#else
|
||||||
|
#error "Cannot detect OpenGL loader!"
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define IMGUI_IMPL_OPENGL_LOADER_GL3W // Default to GL3W
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
20
imgui.cpp
20
imgui.cpp
@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.73 WIP
|
// dear imgui, v1.73
|
||||||
// (main code and documentation)
|
// (main code and documentation)
|
||||||
|
|
||||||
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
|
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
|
||||||
@ -2754,8 +2754,8 @@ ImGuiWindow::ImGuiWindow(ImGuiContext* context, const char* name)
|
|||||||
BeginOrderWithinContext = -1;
|
BeginOrderWithinContext = -1;
|
||||||
PopupId = 0;
|
PopupId = 0;
|
||||||
AutoFitFramesX = AutoFitFramesY = -1;
|
AutoFitFramesX = AutoFitFramesY = -1;
|
||||||
AutoFitOnlyGrows = false;
|
|
||||||
AutoFitChildAxises = 0x00;
|
AutoFitChildAxises = 0x00;
|
||||||
|
AutoFitOnlyGrows = false;
|
||||||
AutoPosLastDirection = ImGuiDir_None;
|
AutoPosLastDirection = ImGuiDir_None;
|
||||||
HiddenFramesCanSkipItems = HiddenFramesCannotSkipItems = 0;
|
HiddenFramesCanSkipItems = HiddenFramesCannotSkipItems = 0;
|
||||||
SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = SetWindowDockAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
|
SetWindowPosAllowFlags = SetWindowSizeAllowFlags = SetWindowCollapsedAllowFlags = SetWindowDockAllowFlags = ImGuiCond_Always | ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing;
|
||||||
@ -4597,8 +4597,13 @@ void ImGui::Render()
|
|||||||
AddRootWindowToDrawData(windows_to_render_top_most[n]);
|
AddRootWindowToDrawData(windows_to_render_top_most[n]);
|
||||||
|
|
||||||
// Draw software mouse cursor if requested
|
// Draw software mouse cursor if requested
|
||||||
if (g.IO.MouseDrawCursor)
|
ImRect mouse_cursor_rect;
|
||||||
RenderMouseCursor(g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor);
|
if (g.IO.MouseDrawCursor && g.MouseCursor != ImGuiMouseCursor_None)
|
||||||
|
{
|
||||||
|
ImVec2 offset, size, uv[4];
|
||||||
|
if (g.IO.Fonts->GetMouseCursorTexData(g.MouseCursor, &offset, &size, &uv[0], &uv[2]))
|
||||||
|
mouse_cursor_rect = ImRect(g.IO.MousePos, g.IO.MousePos + ImVec2(size.x + 2, size.y + 2) * g.Style.MouseCursorScale);
|
||||||
|
}
|
||||||
|
|
||||||
// Setup ImDrawData structures for end-user
|
// Setup ImDrawData structures for end-user
|
||||||
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0;
|
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0;
|
||||||
@ -4607,6 +4612,9 @@ void ImGui::Render()
|
|||||||
ImGuiViewportP* viewport = g.Viewports[n];
|
ImGuiViewportP* viewport = g.Viewports[n];
|
||||||
viewport->DrawDataBuilder.FlattenIntoSingleLayer();
|
viewport->DrawDataBuilder.FlattenIntoSingleLayer();
|
||||||
|
|
||||||
|
if (viewport->GetRect().Overlaps(mouse_cursor_rect))
|
||||||
|
RenderMouseCursor(GetForegroundDrawList(viewport), g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));
|
||||||
|
|
||||||
// Add foreground ImDrawList (for each active viewport)
|
// Add foreground ImDrawList (for each active viewport)
|
||||||
if (viewport->DrawLists[1] != NULL)
|
if (viewport->DrawLists[1] != NULL)
|
||||||
AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
|
AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
|
||||||
@ -5085,7 +5093,7 @@ static bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size
|
|||||||
|
|
||||||
ImGuiWindow* child_window = g.CurrentWindow;
|
ImGuiWindow* child_window = g.CurrentWindow;
|
||||||
child_window->ChildId = id;
|
child_window->ChildId = id;
|
||||||
child_window->AutoFitChildAxises = auto_fit_axises;
|
child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;
|
||||||
|
|
||||||
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
|
// Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
|
||||||
// While this is not really documented/defined, it seems that the expected thing to do.
|
// While this is not really documented/defined, it seems that the expected thing to do.
|
||||||
@ -6492,7 +6500,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|||||||
window->DC.TextWrapPosStack.resize(0);
|
window->DC.TextWrapPosStack.resize(0);
|
||||||
window->DC.CurrentColumns = NULL;
|
window->DC.CurrentColumns = NULL;
|
||||||
window->DC.TreeDepth = 0;
|
window->DC.TreeDepth = 0;
|
||||||
window->DC.TreeStoreMayJumpToParentOnPop = 0x00;
|
window->DC.TreeMayJumpToParentOnPopMask = 0x00;
|
||||||
window->DC.StateStorage = &window->StateStorage;
|
window->DC.StateStorage = &window->StateStorage;
|
||||||
window->DC.GroupStack.resize(0);
|
window->DC.GroupStack.resize(0);
|
||||||
window->MenuColumns.Update(3, style.ItemSpacing.x, window_just_activated_by_user);
|
window->MenuColumns.Update(3, style.ItemSpacing.x, window_just_activated_by_user);
|
||||||
|
6
imgui.h
6
imgui.h
@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.73 WIP
|
// dear imgui, v1.73
|
||||||
// (headers)
|
// (headers)
|
||||||
|
|
||||||
// See imgui.cpp file for documentation.
|
// See imgui.cpp file for documentation.
|
||||||
@ -47,8 +47,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.73 WIP"
|
#define IMGUI_VERSION "1.73"
|
||||||
#define IMGUI_VERSION_NUM 17203
|
#define IMGUI_VERSION_NUM 17300
|
||||||
#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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.73 WIP
|
// dear imgui, v1.73
|
||||||
// (demo code)
|
// (demo code)
|
||||||
|
|
||||||
// Message to the person tempted to delete this file when integrating Dear ImGui into their code base:
|
// Message to the person tempted to delete this file when integrating Dear ImGui into their code base:
|
||||||
@ -107,8 +107,6 @@ Index of this file:
|
|||||||
#define IM_NEWLINE "\n"
|
#define IM_NEWLINE "\n"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IM_MAX(_A,_B) (((_A) >= (_B)) ? (_A) : (_B))
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] Forward Declarations, Helpers
|
// [SECTION] Forward Declarations, Helpers
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -165,8 +163,11 @@ void ImGui::ShowUserGuide()
|
|||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
ImGui::BulletText("Double-click on title bar to collapse window.");
|
ImGui::BulletText("Double-click on title bar to collapse window.");
|
||||||
ImGui::BulletText("Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents).");
|
ImGui::BulletText("Click and drag on lower corner to resize window\n(double-click to auto fit window to its contents).");
|
||||||
ImGui::BulletText("Click and drag on any empty space to move window.");
|
if (io.ConfigWindowsMoveFromTitleBarOnly)
|
||||||
|
ImGui::BulletText("Click and drag on title bar to move window.");
|
||||||
|
else
|
||||||
|
ImGui::BulletText("Click and drag on any empty space to move window.");
|
||||||
ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
|
ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
|
||||||
ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
|
ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
|
||||||
if (io.FontAllowUserScaling)
|
if (io.FontAllowUserScaling)
|
||||||
@ -187,6 +188,12 @@ void ImGui::ShowUserGuide()
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] Demo Window / ShowDemoWindow()
|
// [SECTION] Demo Window / ShowDemoWindow()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
// - ShowDemoWindowWidgets()
|
||||||
|
// - ShowDemoWindowLayout()
|
||||||
|
// - ShowDemoWindowPopups()
|
||||||
|
// - ShowDemoWindowColumns()
|
||||||
|
// - ShowDemoWindowMisc()
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// We split the contents of the big ShowDemoWindow() function into smaller functions (because the link time of very large functions grow non-linearly)
|
// We split the contents of the big ShowDemoWindow() function into smaller functions (because the link time of very large functions grow non-linearly)
|
||||||
static void ShowDemoWindowWidgets();
|
static void ShowDemoWindowWidgets();
|
||||||
@ -230,7 +237,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
|
if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
|
||||||
if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
|
if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
|
||||||
|
|
||||||
// Dear ImGui Apps (accessible from the "Help" menu)
|
// Dear ImGui Apps (accessible from the "Tools" menu)
|
||||||
static bool show_app_metrics = false;
|
static bool show_app_metrics = false;
|
||||||
static bool show_app_style_editor = false;
|
static bool show_app_style_editor = false;
|
||||||
static bool show_app_about = false;
|
static bool show_app_about = false;
|
||||||
@ -307,7 +314,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
ImGui::MenuItem("Documents", NULL, &show_app_documents);
|
ImGui::MenuItem("Documents", NULL, &show_app_documents);
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginMenu("Help"))
|
if (ImGui::BeginMenu("Tools"))
|
||||||
{
|
{
|
||||||
ImGui::MenuItem("Metrics", NULL, &show_app_metrics);
|
ImGui::MenuItem("Metrics", NULL, &show_app_metrics);
|
||||||
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
|
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
|
||||||
@ -325,7 +332,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|||||||
ImGui::Text("PROGRAMMER GUIDE:");
|
ImGui::Text("PROGRAMMER GUIDE:");
|
||||||
ImGui::BulletText("Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
|
ImGui::BulletText("Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
|
||||||
ImGui::BulletText("Please see the comments in imgui.cpp.");
|
ImGui::BulletText("Please see the comments in imgui.cpp.");
|
||||||
ImGui::BulletText("Please see the examples/ in application.");
|
ImGui::BulletText("Please see the examples/ application.");
|
||||||
ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
|
ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
|
||||||
ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
|
ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
@ -725,7 +732,7 @@ static void ShowDemoWindowWidgets()
|
|||||||
{
|
{
|
||||||
static bool closable_group = true;
|
static bool closable_group = true;
|
||||||
ImGui::Checkbox("Show 2nd header", &closable_group);
|
ImGui::Checkbox("Show 2nd header", &closable_group);
|
||||||
if (ImGui::CollapsingHeader("Header"))
|
if (ImGui::CollapsingHeader("Header", ImGuiTreeNodeFlags_None))
|
||||||
{
|
{
|
||||||
ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered());
|
ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered());
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
@ -737,6 +744,10 @@ static void ShowDemoWindowWidgets()
|
|||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
ImGui::Text("More content %d", i);
|
ImGui::Text("More content %d", i);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
if (ImGui::CollapsingHeader("Header with a bullet", ImGuiTreeNodeFlags_Bullet))
|
||||||
|
ImGui::Text("IsItemHovered: %d", ImGui::IsItemHovered());
|
||||||
|
*/
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -744,6 +755,11 @@ static void ShowDemoWindowWidgets()
|
|||||||
{
|
{
|
||||||
ImGui::BulletText("Bullet point 1");
|
ImGui::BulletText("Bullet point 1");
|
||||||
ImGui::BulletText("Bullet point 2\nOn multiple lines");
|
ImGui::BulletText("Bullet point 2\nOn multiple lines");
|
||||||
|
if (ImGui::TreeNode("Tree node"))
|
||||||
|
{
|
||||||
|
ImGui::BulletText("Another bullet point");
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
|
ImGui::Bullet(); ImGui::Text("Bullet point 3 (two calls)");
|
||||||
ImGui::Bullet(); ImGui::SmallButton("Button");
|
ImGui::Bullet(); ImGui::SmallButton("Button");
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
@ -1550,6 +1566,8 @@ static void ShowDemoWindowWidgets()
|
|||||||
// They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets
|
// They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F to allow your own widgets
|
||||||
// to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo.
|
// to use colors in their drag and drop interaction. Also see the demo in Color Picker -> Palette demo.
|
||||||
ImGui::BulletText("Drag and drop in standard widgets");
|
ImGui::BulletText("Drag and drop in standard widgets");
|
||||||
|
ImGui::SameLine();
|
||||||
|
HelpMarker("You can drag from the colored squares.");
|
||||||
ImGui::Indent();
|
ImGui::Indent();
|
||||||
static float col1[3] = { 1.0f,0.0f,0.2f };
|
static float col1[3] = { 1.0f,0.0f,0.2f };
|
||||||
static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
|
static float col2[4] = { 0.4f,0.7f,0.0f,0.5f };
|
||||||
@ -1582,8 +1600,8 @@ static void ShowDemoWindowWidgets()
|
|||||||
// Our buttons are both drag sources and drag targets here!
|
// Our buttons are both drag sources and drag targets here!
|
||||||
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None))
|
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_None))
|
||||||
{
|
{
|
||||||
ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int)); // Set payload to carry the index of our item (could be anything)
|
ImGui::SetDragDropPayload("DND_DEMO_CELL", &n, sizeof(int)); // Set payload to carry the index of our item (could be anything)
|
||||||
if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } // Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.)
|
if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } // Display preview (could be anything, e.g. when dragging an image we could decide to display the filename and a small preview of the image, etc.)
|
||||||
if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); }
|
if (mode == Mode_Move) { ImGui::Text("Move %s", names[n]); }
|
||||||
if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
|
if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); }
|
||||||
ImGui::EndDragDropSource();
|
ImGui::EndDragDropSource();
|
||||||
@ -1622,19 +1640,18 @@ static void ShowDemoWindowWidgets()
|
|||||||
|
|
||||||
if (ImGui::TreeNode("Querying Status (Active/Focused/Hovered etc.)"))
|
if (ImGui::TreeNode("Querying Status (Active/Focused/Hovered etc.)"))
|
||||||
{
|
{
|
||||||
// Display the value of IsItemHovered() and other common item state functions. Note that the flags can be combined.
|
// Submit an item (various types available) so we can query their status in the following block.
|
||||||
// (because BulletText is an item itself and that would affect the output of IsItemHovered() we pass all state in a single call to simplify the code).
|
|
||||||
static int item_type = 1;
|
static int item_type = 1;
|
||||||
static bool b = false;
|
|
||||||
static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
|
|
||||||
static char str[16] = {};
|
|
||||||
ImGui::Combo("Item Type", &item_type, "Text\0Button\0Button (w/ repeat)\0Checkbox\0SliderFloat\0InputText\0InputFloat\0InputFloat3\0ColorEdit4\0MenuItem\0TreeNode (w/ double-click)\0ListBox\0");
|
ImGui::Combo("Item Type", &item_type, "Text\0Button\0Button (w/ repeat)\0Checkbox\0SliderFloat\0InputText\0InputFloat\0InputFloat3\0ColorEdit4\0MenuItem\0TreeNode (w/ double-click)\0ListBox\0");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions.");
|
HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions.");
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
static bool b = false;
|
||||||
|
static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
|
||||||
|
static char str[16] = {};
|
||||||
if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
|
if (item_type == 0) { ImGui::Text("ITEM: Text"); } // Testing text items with no identifier/interaction
|
||||||
if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
|
if (item_type == 1) { ret = ImGui::Button("ITEM: Button"); } // Testing button
|
||||||
if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater)
|
if (item_type == 2) { ImGui::PushButtonRepeat(true); ret = ImGui::Button("ITEM: Button"); ImGui::PopButtonRepeat(); } // Testing button (with repeater)
|
||||||
if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox
|
if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox
|
||||||
if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item
|
if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item
|
||||||
if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing)
|
if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing)
|
||||||
@ -1644,6 +1661,11 @@ static void ShowDemoWindowWidgets()
|
|||||||
if (item_type == 9) { ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
|
if (item_type == 9) { ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
|
||||||
if (item_type == 10){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
|
if (item_type == 10){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
|
||||||
if (item_type == 11){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", ¤t, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
|
if (item_type == 11){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", ¤t, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
|
||||||
|
|
||||||
|
// Display the value of IsItemHovered() and other common item state functions.
|
||||||
|
// Note that the ImGuiHoveredFlags_XXX flags can be combined.
|
||||||
|
// Because BulletText is an item itself and that would affect the output of IsItemXXX functions,
|
||||||
|
// we query every state in a single call to avoid storing them and to simplify the code
|
||||||
ImGui::BulletText(
|
ImGui::BulletText(
|
||||||
"Return value = %d\n"
|
"Return value = %d\n"
|
||||||
"IsItemFocused() = %d\n"
|
"IsItemFocused() = %d\n"
|
||||||
@ -1686,7 +1708,8 @@ static void ShowDemoWindowWidgets()
|
|||||||
if (embed_all_inside_a_child_window)
|
if (embed_all_inside_a_child_window)
|
||||||
ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true);
|
ImGui::BeginChild("outer_child", ImVec2(0, ImGui::GetFontSize() * 20), true);
|
||||||
|
|
||||||
// Testing IsWindowFocused() function with its various flags. Note that the flags can be combined.
|
// Testing IsWindowFocused() function with its various flags.
|
||||||
|
// Note that the ImGuiFocusedFlags_XXX flags can be combined.
|
||||||
ImGui::BulletText(
|
ImGui::BulletText(
|
||||||
"IsWindowFocused() = %d\n"
|
"IsWindowFocused() = %d\n"
|
||||||
"IsWindowFocused(_ChildWindows) = %d\n"
|
"IsWindowFocused(_ChildWindows) = %d\n"
|
||||||
@ -1699,7 +1722,8 @@ static void ShowDemoWindowWidgets()
|
|||||||
ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow),
|
ImGui::IsWindowFocused(ImGuiFocusedFlags_RootWindow),
|
||||||
ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow));
|
ImGui::IsWindowFocused(ImGuiFocusedFlags_AnyWindow));
|
||||||
|
|
||||||
// Testing IsWindowHovered() function with its various flags. Note that the flags can be combined.
|
// Testing IsWindowHovered() function with its various flags.
|
||||||
|
// Note that the ImGuiHoveredFlags_XXX flags can be combined.
|
||||||
ImGui::BulletText(
|
ImGui::BulletText(
|
||||||
"IsWindowHovered() = %d\n"
|
"IsWindowHovered() = %d\n"
|
||||||
"IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
|
"IsWindowHovered(_AllowWhenBlockedByPopup) = %d\n"
|
||||||
@ -2856,6 +2880,8 @@ static void ShowDemoWindowMisc()
|
|||||||
{
|
{
|
||||||
if (ImGui::CollapsingHeader("Filtering"))
|
if (ImGui::CollapsingHeader("Filtering"))
|
||||||
{
|
{
|
||||||
|
// Helper class to easy setup a text filter.
|
||||||
|
// You may want to implement a more feature-full filtering scheme in your own application.
|
||||||
static ImGuiTextFilter filter;
|
static ImGuiTextFilter filter;
|
||||||
ImGui::Text("Filter usage:\n"
|
ImGui::Text("Filter usage:\n"
|
||||||
" \"\" display all lines\n"
|
" \"\" display all lines\n"
|
||||||
@ -2873,12 +2899,14 @@ static void ShowDemoWindowMisc()
|
|||||||
{
|
{
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
|
|
||||||
|
// Display ImGuiIO output flags
|
||||||
ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse);
|
ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse);
|
||||||
ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
|
ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
|
||||||
ImGui::Text("WantTextInput: %d", io.WantTextInput);
|
ImGui::Text("WantTextInput: %d", io.WantTextInput);
|
||||||
ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos);
|
ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos);
|
||||||
ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible);
|
ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible);
|
||||||
|
|
||||||
|
// Display Keyboard/Mouse state
|
||||||
if (ImGui::TreeNode("Keyboard, Mouse & Navigation State"))
|
if (ImGui::TreeNode("Keyboard, Mouse & Navigation State"))
|
||||||
{
|
{
|
||||||
if (ImGui::IsMousePosValid())
|
if (ImGui::IsMousePosValid())
|
||||||
@ -3011,7 +3039,7 @@ static void ShowDemoWindowMisc()
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] About Window / ShowAboutWindow()
|
// [SECTION] About Window / ShowAboutWindow()
|
||||||
// Access from Dear ImGui Demo -> Help -> About
|
// Access from Dear ImGui Demo -> Tools -> About
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void ImGui::ShowAboutWindow(bool* p_open)
|
void ImGui::ShowAboutWindow(bool* p_open)
|
||||||
@ -3023,7 +3051,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
|||||||
}
|
}
|
||||||
ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
|
ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text("By Omar Cornut and all dear imgui contributors.");
|
ImGui::Text("By Omar Cornut and all Dear ImGui contributors.");
|
||||||
ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
|
ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
|
||||||
|
|
||||||
static bool show_config_info = false;
|
static bool show_config_info = false;
|
||||||
@ -3164,6 +3192,10 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] Style Editor / ShowStyleEditor()
|
// [SECTION] Style Editor / ShowStyleEditor()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
// - ShowStyleSelector()
|
||||||
|
// - ShowFontSelector()
|
||||||
|
// - ShowStyleEditor()
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options.
|
// Demo helper function to select among default colors. See ShowStyleEditor() for more advanced options.
|
||||||
// Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally.
|
// Here we use the simplified Combo() api that packs items into a single literal string. Useful for quick combo boxes where the choices are known locally.
|
||||||
@ -3458,6 +3490,9 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar()
|
// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
// - ShowExampleAppMainMenuBar()
|
||||||
|
// - ShowExampleMenuFile()
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Demonstrate creating a "main" fullscreen menu bar and populating it.
|
// Demonstrate creating a "main" fullscreen menu bar and populating it.
|
||||||
// Note the difference between BeginMainMenuBar() and BeginMenuBar():
|
// Note the difference between BeginMainMenuBar() and BeginMenuBar():
|
||||||
@ -4253,7 +4288,7 @@ static void ShowExampleAppConstrainedResize(bool* p_open)
|
|||||||
{
|
{
|
||||||
struct CustomConstraints // Helper functions to demonstrate programmatic constraints
|
struct CustomConstraints // Helper functions to demonstrate programmatic constraints
|
||||||
{
|
{
|
||||||
static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize = ImVec2(IM_MAX(data->DesiredSize.x, data->DesiredSize.y), IM_MAX(data->DesiredSize.x, data->DesiredSize.y)); }
|
static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = (data->DesiredSize.x > data->DesiredSize.y ? data->DesiredSize.x : data->DesiredSize.y); }
|
||||||
static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); }
|
static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.73 WIP
|
// dear imgui, v1.73
|
||||||
// (drawing and font code)
|
// (drawing and font code)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -3046,39 +3046,24 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
|
|||||||
// - RenderRectFilledWithHole()
|
// - RenderRectFilledWithHole()
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void ImGui::RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor)
|
void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
|
||||||
{
|
{
|
||||||
if (mouse_cursor == ImGuiMouseCursor_None)
|
if (mouse_cursor == ImGuiMouseCursor_None)
|
||||||
return;
|
return;
|
||||||
IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
|
IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
|
||||||
|
|
||||||
const ImU32 col_shadow = IM_COL32(0, 0, 0, 48);
|
ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas;
|
||||||
const ImU32 col_border = IM_COL32(0, 0, 0, 255); // Black
|
|
||||||
const ImU32 col_fill = IM_COL32(255, 255, 255, 255); // White
|
|
||||||
|
|
||||||
ImGuiContext& g = *GImGui;
|
|
||||||
ImFontAtlas* font_atlas = g.IO.Fonts;
|
|
||||||
ImVec2 offset, size, uv[4];
|
ImVec2 offset, size, uv[4];
|
||||||
if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
|
if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
|
||||||
{
|
{
|
||||||
pos -= offset;
|
pos -= offset;
|
||||||
const ImTextureID tex_id = font_atlas->TexID;
|
const ImTextureID tex_id = font_atlas->TexID;
|
||||||
|
draw_list->PushTextureID(tex_id);
|
||||||
// We need to account for the possibility of the mouse cursor straddling multiple viewports...
|
draw_list->AddImage(tex_id, pos + ImVec2(1, 0)*scale, pos + ImVec2(1, 0)*scale + size*scale, uv[2], uv[3], col_shadow);
|
||||||
for (int viewport_n = 0; viewport_n < g.Viewports.Size; viewport_n++)
|
draw_list->AddImage(tex_id, pos + ImVec2(2, 0)*scale, pos + ImVec2(2, 0)*scale + size*scale, uv[2], uv[3], col_shadow);
|
||||||
{
|
draw_list->AddImage(tex_id, pos, pos + size*scale, uv[2], uv[3], col_border);
|
||||||
ImGuiViewportP* viewport = g.Viewports[viewport_n];
|
draw_list->AddImage(tex_id, pos, pos + size*scale, uv[0], uv[1], col_fill);
|
||||||
if (!viewport->GetRect().Overlaps(ImRect(pos, pos + ImVec2(size.x + 2, size.y + 2) * scale)))
|
draw_list->PopTextureID();
|
||||||
continue;
|
|
||||||
|
|
||||||
ImDrawList* draw_list = GetForegroundDrawList(viewport);
|
|
||||||
draw_list->PushTextureID(tex_id);
|
|
||||||
draw_list->AddImage(tex_id, pos + ImVec2(1,0)*scale, pos + ImVec2(1,0)*scale + size*scale, uv[2], uv[3], col_shadow);
|
|
||||||
draw_list->AddImage(tex_id, pos + ImVec2(2,0)*scale, pos + ImVec2(2,0)*scale + size*scale, uv[2], uv[3], col_shadow);
|
|
||||||
draw_list->AddImage(tex_id, pos, pos + size*scale, uv[2], uv[3], col_border);
|
|
||||||
draw_list->AddImage(tex_id, pos, pos + size*scale, uv[0], uv[1], col_fill);
|
|
||||||
draw_list->PopTextureID();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.73 WIP
|
// dear imgui, v1.73
|
||||||
// (internal structures/api)
|
// (internal structures/api)
|
||||||
|
|
||||||
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
|
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
|
||||||
@ -1366,20 +1366,20 @@ struct ImGuiContext
|
|||||||
// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
|
// FIXME: That's theory, in practice the delimitation between ImGuiWindow and ImGuiWindowTempData is quite tenuous and could be reconsidered.
|
||||||
struct IMGUI_API ImGuiWindowTempData
|
struct IMGUI_API ImGuiWindowTempData
|
||||||
{
|
{
|
||||||
ImVec2 CursorPos;
|
ImVec2 CursorPos; // Current emitting position, in absolute coordinates.
|
||||||
ImVec2 CursorPosPrevLine;
|
ImVec2 CursorPosPrevLine;
|
||||||
ImVec2 CursorStartPos; // Initial position in client area with padding
|
ImVec2 CursorStartPos; // Initial position after Begin(), generally ~ window position + WindowPadding.
|
||||||
ImVec2 CursorMaxPos; // Used to implicitly calculate the size of our contents, always growing during the frame. Used to calculate window->ContentSize at the beginning of next frame
|
ImVec2 CursorMaxPos; // Used to implicitly calculate the size of our contents, always growing during the frame. Used to calculate window->ContentSize at the beginning of next frame
|
||||||
ImVec2 CurrLineSize;
|
ImVec2 CurrLineSize;
|
||||||
ImVec2 PrevLineSize;
|
ImVec2 PrevLineSize;
|
||||||
float CurrLineTextBaseOffset;
|
float CurrLineTextBaseOffset; // Baseline offset (0.0f by default on a new line, generally == style.FramePadding.y when a framed item has been added).
|
||||||
float PrevLineTextBaseOffset;
|
float PrevLineTextBaseOffset;
|
||||||
int TreeDepth;
|
int TreeDepth; // Current tree depth.
|
||||||
ImU32 TreeStoreMayJumpToParentOnPop; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary.
|
ImU32 TreeMayJumpToParentOnPopMask; // Store a copy of !g.NavIdIsAlive for TreeDepth 0..31.. Could be turned into a ImU64 if necessary.
|
||||||
ImGuiID LastItemId;
|
ImGuiID LastItemId; // ID for last item
|
||||||
ImGuiItemStatusFlags LastItemStatusFlags;
|
ImGuiItemStatusFlags LastItemStatusFlags; // Status flags for last item (see ImGuiItemStatusFlags_)
|
||||||
ImRect LastItemRect; // Interaction rect
|
ImRect LastItemRect; // Interaction rect for last item
|
||||||
ImRect LastItemDisplayRect; // End-user display rect (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
|
ImRect LastItemDisplayRect; // End-user display rect for last item (only valid if LastItemStatusFlags & ImGuiItemStatusFlags_HasDisplayRect)
|
||||||
ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1)
|
ImGuiNavLayer NavLayerCurrent; // Current layer, 0..31 (we currently only use 0..1)
|
||||||
int NavLayerCurrentMask; // = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
|
int NavLayerCurrentMask; // = (1 << NavLayerCurrent) used by ItemAdd prior to clipping.
|
||||||
int NavLayerActiveMask; // Which layer have been written to (result from previous frame)
|
int NavLayerActiveMask; // Which layer have been written to (result from previous frame)
|
||||||
@ -1389,7 +1389,7 @@ struct IMGUI_API ImGuiWindowTempData
|
|||||||
bool MenuBarAppending; // FIXME: Remove this
|
bool MenuBarAppending; // FIXME: Remove this
|
||||||
ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
|
ImVec2 MenuBarOffset; // MenuBarOffset.x is sort of equivalent of a per-layer CursorPos.x, saved/restored as we switch to the menu bar. The only situation when MenuBarOffset.y is > 0 if when (SafeAreaPadding.y > FramePadding.y), often used on TVs.
|
||||||
ImVector<ImGuiWindow*> ChildWindows;
|
ImVector<ImGuiWindow*> ChildWindows;
|
||||||
ImGuiStorage* StateStorage;
|
ImGuiStorage* StateStorage; // Current persistent per-window storage (store e.g. tree node open/close state)
|
||||||
ImGuiLayoutType LayoutType;
|
ImGuiLayoutType LayoutType;
|
||||||
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
|
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
|
||||||
int FocusCounterAll; // Counter for focus/tabbing system. Start at -1 and increase as assigned via FocusableItemRegister() (FIXME-NAV: Needs redesign)
|
int FocusCounterAll; // Counter for focus/tabbing system. Start at -1 and increase as assigned via FocusableItemRegister() (FIXME-NAV: Needs redesign)
|
||||||
@ -1416,7 +1416,7 @@ struct IMGUI_API ImGuiWindowTempData
|
|||||||
CurrLineSize = PrevLineSize = ImVec2(0.0f, 0.0f);
|
CurrLineSize = PrevLineSize = ImVec2(0.0f, 0.0f);
|
||||||
CurrLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f;
|
CurrLineTextBaseOffset = PrevLineTextBaseOffset = 0.0f;
|
||||||
TreeDepth = 0;
|
TreeDepth = 0;
|
||||||
TreeStoreMayJumpToParentOnPop = 0x00;
|
TreeMayJumpToParentOnPopMask = 0x00;
|
||||||
LastItemId = 0;
|
LastItemId = 0;
|
||||||
LastItemStatusFlags = 0;
|
LastItemStatusFlags = 0;
|
||||||
LastItemRect = LastItemDisplayRect = ImRect();
|
LastItemRect = LastItemDisplayRect = ImRect();
|
||||||
@ -1459,9 +1459,9 @@ struct IMGUI_API ImGuiWindow
|
|||||||
ImVec2 SizeFull; // Size when non collapsed
|
ImVec2 SizeFull; // Size when non collapsed
|
||||||
ImVec2 ContentSize; // Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding.
|
ImVec2 ContentSize; // Size of contents/scrollable client area (calculated from the extents reach of the cursor) from previous frame. Does not include window decoration or window padding.
|
||||||
ImVec2 ContentSizeExplicit; // Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize().
|
ImVec2 ContentSizeExplicit; // Size of contents/scrollable client area explicitly request by the user via SetNextWindowContentSize().
|
||||||
ImVec2 WindowPadding; // Window padding at the time of begin.
|
ImVec2 WindowPadding; // Window padding at the time of Begin().
|
||||||
float WindowRounding; // Window rounding at the time of begin.
|
float WindowRounding; // Window rounding at the time of Begin().
|
||||||
float WindowBorderSize; // Window border size at the time of begin.
|
float WindowBorderSize; // Window border size at the time of Begin().
|
||||||
int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
|
int NameBufLen; // Size of buffer storing Name. May be larger than strlen(Name)!
|
||||||
ImGuiID MoveId; // == window->GetID("#MOVE")
|
ImGuiID MoveId; // == window->GetID("#MOVE")
|
||||||
ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
|
ImGuiID ChildId; // ID of corresponding item in parent window (for navigation to return from child window to parent window)
|
||||||
@ -1470,7 +1470,7 @@ struct IMGUI_API ImGuiWindow
|
|||||||
ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
|
ImVec2 ScrollTarget; // target scroll position. stored as cursor position with scrolling canceled out, so the highest point is always 0.0f. (FLT_MAX for no change)
|
||||||
ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
|
ImVec2 ScrollTargetCenterRatio; // 0.0f = scroll so that target position is at top, 0.5f = scroll so that target position is centered
|
||||||
ImVec2 ScrollbarSizes; // Size taken by scrollbars on each axis
|
ImVec2 ScrollbarSizes; // Size taken by scrollbars on each axis
|
||||||
bool ScrollbarX, ScrollbarY;
|
bool ScrollbarX, ScrollbarY; // Are scrollbars visible?
|
||||||
bool ViewportOwned;
|
bool ViewportOwned;
|
||||||
bool Active; // Set to true on Begin(), unless Collapsed
|
bool Active; // Set to true on Begin(), unless Collapsed
|
||||||
bool WasActive;
|
bool WasActive;
|
||||||
@ -1487,9 +1487,9 @@ struct IMGUI_API ImGuiWindow
|
|||||||
short BeginOrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0.
|
short BeginOrderWithinParent; // Order within immediate parent window, if we are a child window. Otherwise 0.
|
||||||
short BeginOrderWithinContext; // Order within entire imgui context. This is mostly used for debugging submission order related issues.
|
short BeginOrderWithinContext; // Order within entire imgui context. This is mostly used for debugging submission order related issues.
|
||||||
ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
|
ImGuiID PopupId; // ID in the popup stack when this window is used as a popup/menu (because we use generic Name/ID for recycling)
|
||||||
int AutoFitFramesX, AutoFitFramesY;
|
ImS8 AutoFitFramesX, AutoFitFramesY;
|
||||||
|
ImS8 AutoFitChildAxises;
|
||||||
bool AutoFitOnlyGrows;
|
bool AutoFitOnlyGrows;
|
||||||
int AutoFitChildAxises;
|
|
||||||
ImGuiDir AutoPosLastDirection;
|
ImGuiDir AutoPosLastDirection;
|
||||||
int HiddenFramesCanSkipItems; // Hide the window for N frames
|
int HiddenFramesCanSkipItems; // Hide the window for N frames
|
||||||
int HiddenFramesCannotSkipItems; // Hide the window for N frames while allowing items to be submitted so we can measure their size
|
int HiddenFramesCannotSkipItems; // Hide the window for N frames while allowing items to be submitted so we can measure their size
|
||||||
@ -1515,7 +1515,7 @@ struct IMGUI_API ImGuiWindow
|
|||||||
|
|
||||||
int LastFrameActive; // Last frame number the window was Active.
|
int LastFrameActive; // Last frame number the window was Active.
|
||||||
int LastFrameJustFocused; // Last frame number the window was made Focused.
|
int LastFrameJustFocused; // Last frame number the window was made Focused.
|
||||||
float LastTimeActive;
|
float LastTimeActive; // Last timestamp the window was Active (using float as we don't need high precision there)
|
||||||
float ItemWidthDefault;
|
float ItemWidthDefault;
|
||||||
ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items
|
ImGuiMenuColumns MenuColumns; // Simplified columns storage for menu items
|
||||||
ImGuiStorage StateStorage;
|
ImGuiStorage StateStorage;
|
||||||
@ -1882,6 +1882,7 @@ namespace ImGui
|
|||||||
// Render helpers (those functions don't access any ImGui state!)
|
// Render helpers (those functions don't access any ImGui state!)
|
||||||
IMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f);
|
IMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f);
|
||||||
IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);
|
IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);
|
||||||
|
IMGUI_API void RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
|
||||||
IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
|
IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
|
||||||
IMGUI_API void RenderArrowDockMenu(ImDrawList* draw_list, ImVec2 p_min, float sz, ImU32 col);
|
IMGUI_API void RenderArrowDockMenu(ImDrawList* draw_list, ImVec2 p_min, float sz, ImU32 col);
|
||||||
IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
|
IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// dear imgui, v1.73 WIP
|
// dear imgui, v1.73
|
||||||
// (widgets code)
|
// (widgets code)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5224,7 +5224,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
|||||||
const float text_offset_x = g.FontSize + (display_frame ? padding.x*3 : padding.x*2); // Collapser arrow width + Spacing
|
const float text_offset_x = g.FontSize + (display_frame ? padding.x*3 : padding.x*2); // Collapser arrow width + Spacing
|
||||||
const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it
|
const float text_offset_y = ImMax(padding.y, window->DC.CurrLineTextBaseOffset); // Latch before ItemSize changes it
|
||||||
const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x*2 : 0.0f); // Include collapser
|
const float text_width = g.FontSize + (label_size.x > 0.0f ? label_size.x + padding.x*2 : 0.0f); // Include collapser
|
||||||
const ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y);
|
ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y);
|
||||||
ItemSize(ImVec2(text_width, frame_height), text_offset_y);
|
ItemSize(ImVec2(text_width, frame_height), text_offset_y);
|
||||||
|
|
||||||
// For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing
|
// For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing
|
||||||
@ -5238,7 +5238,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
|||||||
const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0;
|
const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0;
|
||||||
bool is_open = TreeNodeBehaviorIsOpen(id, flags);
|
bool is_open = TreeNodeBehaviorIsOpen(id, flags);
|
||||||
if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
|
if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
|
||||||
window->DC.TreeStoreMayJumpToParentOnPop |= (1 << window->DC.TreeDepth);
|
window->DC.TreeMayJumpToParentOnPopMask |= (1 << window->DC.TreeDepth);
|
||||||
|
|
||||||
bool item_add = ItemAdd(interact_bb, id);
|
bool item_add = ItemAdd(interact_bb, id);
|
||||||
window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDisplayRect;
|
window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDisplayRect;
|
||||||
@ -5317,7 +5317,12 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
|||||||
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
|
const ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header);
|
||||||
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding);
|
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, true, style.FrameRounding);
|
||||||
RenderNavHighlight(frame_bb, id, nav_highlight_flags);
|
RenderNavHighlight(frame_bb, id, nav_highlight_flags);
|
||||||
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 1.0f);
|
if (flags & ImGuiTreeNodeFlags_Bullet)
|
||||||
|
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.60f, text_pos.y + g.FontSize * 0.5f), text_col);
|
||||||
|
else if (!is_leaf)
|
||||||
|
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 1.0f);
|
||||||
|
else // Leaf without bullet, left-adjusted text
|
||||||
|
text_pos.x -= text_offset_x;
|
||||||
if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton)
|
if (flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton)
|
||||||
frame_bb.Max.x -= g.FontSize + style.FramePadding.x;
|
frame_bb.Max.x -= g.FontSize + style.FramePadding.x;
|
||||||
if (g.LogEnabled)
|
if (g.LogEnabled)
|
||||||
@ -5343,11 +5348,10 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
|
|||||||
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
|
RenderFrame(frame_bb.Min, frame_bb.Max, bg_col, false);
|
||||||
RenderNavHighlight(frame_bb, id, nav_highlight_flags);
|
RenderNavHighlight(frame_bb, id, nav_highlight_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & ImGuiTreeNodeFlags_Bullet)
|
if (flags & ImGuiTreeNodeFlags_Bullet)
|
||||||
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize*0.50f), text_col);
|
RenderBullet(window->DrawList, ImVec2(text_pos.x - text_offset_x * 0.5f, text_pos.y + g.FontSize * 0.5f), text_col);
|
||||||
else if (!is_leaf)
|
else if (!is_leaf)
|
||||||
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize*0.15f), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f);
|
RenderArrow(window->DrawList, ImVec2(text_pos.x - text_offset_x + padding.x, text_pos.y + g.FontSize * 0.15f), text_col, is_open ? ImGuiDir_Down : ImGuiDir_Right, 0.70f);
|
||||||
if (g.LogEnabled)
|
if (g.LogEnabled)
|
||||||
LogRenderedText(&text_pos, ">");
|
LogRenderedText(&text_pos, ">");
|
||||||
RenderText(text_pos, label, label_end, false);
|
RenderText(text_pos, label, label_end, false);
|
||||||
@ -5390,13 +5394,16 @@ void ImGui::TreePop()
|
|||||||
Unindent();
|
Unindent();
|
||||||
|
|
||||||
window->DC.TreeDepth--;
|
window->DC.TreeDepth--;
|
||||||
|
ImU32 tree_depth_mask = (1 << window->DC.TreeDepth);
|
||||||
|
|
||||||
|
// Handle Left arrow to move to parent tree node (when ImGuiTreeNodeFlags_NavLeftJumpsBackHere is enabled)
|
||||||
if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
|
if (g.NavMoveDir == ImGuiDir_Left && g.NavWindow == window && NavMoveRequestButNoResultYet())
|
||||||
if (g.NavIdIsAlive && (window->DC.TreeStoreMayJumpToParentOnPop & (1 << window->DC.TreeDepth)))
|
if (g.NavIdIsAlive && (window->DC.TreeMayJumpToParentOnPopMask & tree_depth_mask))
|
||||||
{
|
{
|
||||||
SetNavID(window->IDStack.back(), g.NavLayer);
|
SetNavID(window->IDStack.back(), g.NavLayer);
|
||||||
NavMoveRequestCancel();
|
NavMoveRequestCancel();
|
||||||
}
|
}
|
||||||
window->DC.TreeStoreMayJumpToParentOnPop &= (1 << window->DC.TreeDepth) - 1;
|
window->DC.TreeMayJumpToParentOnPopMask &= tree_depth_mask - 1;
|
||||||
|
|
||||||
IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much.
|
IM_ASSERT(window->IDStack.Size > 1); // There should always be 1 element in the IDStack (pushed during window creation). If this triggers you called TreePop/PopID too much.
|
||||||
PopID();
|
PopID();
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
dear imgui, v1.73 WIP
|
----------------------------------------------------------------------
|
||||||
(Font Readme)
|
dear imgui, v1.73
|
||||||
|
----------------------------------------------------------------------
|
||||||
---------------------------------------
|
misc/fonts/README.txt
|
||||||
|
This is the Readme dedicated to fonts.
|
||||||
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
The code in imgui.cpp embeds a copy of 'ProggyClean.ttf' (by Tristan Grimmer),
|
The code in imgui.cpp embeds a copy of 'ProggyClean.ttf' (by Tristan Grimmer),
|
||||||
a 13 pixels high, pixel-perfect font used by default.
|
a 13 pixels high, pixel-perfect font used by default.
|
||||||
|
Loading…
Reference in New Issue
Block a user