Skip to content

Commit 0e88430

Browse files
committed
Merge branch 'master' into docking
# Conflicts: # examples/imgui_impl_opengl3.cpp # imgui.h
2 parents 9085c2c + 05420ea commit 0e88430

File tree

18 files changed

+227
-137
lines changed

18 files changed

+227
-137
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
203203
- name: Build example_null (with ImWchar32)
204204
run: |
205-
echo '#define ImWchar ImWchar32' > example_single_file.cpp
205+
echo '#define IMGUI_USE_WCHAR32' > example_single_file.cpp
206206
echo '#define IMGUI_IMPLEMENTATION' >> example_single_file.cpp
207207
echo '#include "misc/single_file/imgui_single_file.h"' >> example_single_file.cpp
208208
echo '#include "examples/example_null/main.cpp"' >> example_single_file.cpp

docs/CHANGELOG.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,15 @@ Other Changes:
114114
when the menu is not open. (#3030)
115115
- InputText: Fixed password fields displaying ASCII spaces as blanks instead of using the '*'
116116
glyph. (#2149, #515)
117+
- Selectable: Fixed honoring style.SelectableTextAlign with unspecified size. (#2347, #2601)
118+
- Selectable: Allow using ImGuiSelectableFlags_SpanAllColumns in other columns than first. (#125)
119+
- TreeNode: Made clicking on arrow with _OpenOnArrow toggle the open state on the Mouse Down
120+
event rather than the Mouse Down+Up sequence (this is rather standard behavior).
121+
- Scrolling: Fixed scrolling centering API leading to non-integer scrolling values and initial
122+
cursor position. This would often get fixed after the fix item submission, but using the
123+
ImGuiListClipper as the first thing after Begin() could largely break size calculations. (#3073)
117124
- Added optional support for Unicode plane 1-16 (#2538, #2541, #2815) [@cloudwu, @samhocevar]
118-
- Compile-time enable with '#define ImWchar ImWchar32' in imconfig.h.
125+
- Compile-time enable with '#define IMGUI_USE_WCHAR32' in imconfig.h.
119126
- Generally more consistent support for unsupported codepoints (0xFFFD), in particular when
120127
using the default, non-fitting characters will be turned into 0xFFFD instead of being ignored.
121128
- Surrogate pairs are supported when submitting UTF-16 data via io.AddInputCharacterUTF16(),
@@ -134,6 +141,7 @@ Other Changes:
134141
- CI: Added more tests on the continuous-integration server: extra warnings for Clang/GCC, building
135142
SDL+Metal example, building imgui_freetype.cpp, more compile-time imconfig.h settings: disabling
136143
obsolete functions, enabling 32-bit ImDrawIdx, enabling 32-bit ImWchar, disabling demo. [@rokups]
144+
- Backends: OpenGL3: Added include support for older glbinding 2.x loader. (#3061) [@DonKult]
137145
- Backends: Win32: Added ImGui_ImplWin32_EnableDpiAwareness(), ImGui_ImplWin32_GetDpiScaleForHwnd(),
138146
ImGui_ImplWin32_GetDpiScaleForMonitor() helpers functions (backported from the docking branch).
139147
Those functions makes it easier for example apps to support hi-dpi features without setting up
@@ -238,7 +246,7 @@ Other Changes:
238246
- Examples: OpenGL: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking
239247
settings (otherwise if another loader such as Glew is accessible, the OpenGL3 backend might
240248
automatically use it). (#2919, #2798)
241-
- Examples: OpenGL: Added support for glbindings OpenGL loader. (#2870) [@rokups]
249+
- Examples: OpenGL: Added support for glbinding OpenGL loader. (#2870) [@rokups]
242250
- Examples: Emscripten: Demonstrating embedding fonts in Makefile and code. (#2953) [@Oipo]
243251
- Examples: Metal: Wrapped main loop in @autoreleasepool block to ensure allocations get freed
244252
even if underlying system event loop gets paused due to app nap. (#2910, #2917) [@bear24rw]

docs/FAQ.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ You may take a look at:
552552

553553
- [Quotes](https://github.com/ocornut/imgui/wiki/Quotes)
554554
- [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui)
555-
- [Gallery](https://github.com/ocornut/imgui/issues/2847)
555+
- [Gallery](https://github.com/ocornut/imgui/issues/3075)
556556

557557
##### [Return to Index](#index)
558558

@@ -598,7 +598,7 @@ There is an auto-generated [c-api for Dear ImGui (cimgui)](https://github.com/ci
598598
- Individuals: you can support continued maintenance and development via PayPal donations. See [README](https://github.com/ocornut/imgui/blob/master/docs/README.md).
599599
- If you are experienced with Dear ImGui and C++, look at the [GitHub Issues](https://github.com/ocornut/imgui/issues), look at the [Wiki](https://github.com/ocornut/imgui/wiki), read [docs/TODO.txt](https://github.com/ocornut/imgui/blob/master/docs/TODO.txt) and see how you want to help and can help!
600600
- Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
601-
You may post screenshot or links in the [gallery threads](https://github.com/ocornut/imgui/issues/2847). Visuals are ideal as they inspire other programmers. Disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
601+
You may post screenshot or links in the [gallery threads](https://github.com/ocornut/imgui/issues/3075). Visuals are ideal as they inspire other programmers. Disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
602602
- If you have issues or if you need to hack into the library, even if you don't expect any support it is useful that you share your issues or sometimes incomplete PR.
603603

604604
##### [Return to Index](#index)

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ ImGui::End();
8080
Result:
8181
<br>![sample code output](https://raw.githubusercontent.com/wiki/ocornut/imgui/web/v160/code_sample_03_color.gif)
8282

83-
Dear ImGui allows you **create elaborate tools** as well as very short-lived ones. On the extreme side of short-livedness: 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.
83+
Dear ImGui allows you to **create elaborate tools** as well as very short-lived ones. On the extreme side of short-livedness: 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.
8484

8585
### How it works
8686

@@ -131,7 +131,7 @@ Some of the goals for 2020 are:
131131

132132
### Gallery
133133

134-
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/2847)!
134+
For more user-submitted screenshots of projects using Dear ImGui, check out the [Gallery Threads](https://github.com/ocornut/imgui/issues/3075)!
135135

136136
Custom engine
137137
[![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)
@@ -164,7 +164,7 @@ You may also peak at the [Multi-Viewport](https://github.com/ocornut/imgui/issue
164164

165165
**Who uses Dear ImGui?**
166166

167-
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes), [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors), [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for an idea of who is using Dear ImGui. Please add your game/software if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/2847)!
167+
See the [Quotes](https://github.com/ocornut/imgui/wiki/Quotes), [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors), [Software using dear imgui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) Wiki pages for an idea of who is using Dear ImGui. Please add your game/software if you can! Also see the [Gallery Threads](https://github.com/ocornut/imgui/issues/3075)!
168168

169169
How to help
170170
-----------

docs/TODO.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
7171
- widgets: alignment options in style (e.g. center Selectable, Right-Align within Button, etc.) #1260
7272
- widgets: activate by identifier (trigger button, focus given id)
7373
- widgets: a way to represent "mixed" values, so e.g. all values replaced with *, including check-boxes, colors, etc. with support for multi-components widgets (e.g. SliderFloat3, make only "Y" mixed) (#2644)
74-
- widgets: selectable: generic BeginSelectable()/EndSelectable() mechanism.
75-
- widgets: selectable: a way to visualize partial/mixed selection (e.g. parent tree node has children with mixed selection)
7674
- widgets: checkbox: checkbox with custom glyph inside frame.
7775
- widgets: coloredit: keep reporting as active when picker is on?
7876
- widgets: group/scalarn functions: expose more per-component information. e.g. store NextItemData.ComponentIdx set by scalarn function, groups can expose them back somehow.
77+
- selectable: using (size.x == 0.0f) and (SelectableTextAlign.x > 0.0f) followed by SameLine() is currently not supported.
78+
- selectable: generic BeginSelectable()/EndSelectable() mechanism.
79+
- selectable: a way to visualize partial/mixed selection (e.g. parent tree node has children with mixed selection)
7980

8081
- input text: clean up the mess caused by converting UTF-8 <> wchar. the code is rather inefficient right now and super fragile.
8182
- input text: reorganize event handling, allow CharFilter to modify buffers, allow multiple events? (#541)
@@ -251,6 +252,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
251252
- menus: menu-bar: main menu-bar could affect clamping of windows position (~ akin to modifying DisplayMin)
252253
- menus: hovering from menu to menu on a menu-bar has 1 frame without any menu, which is a little annoying. ideally either 0 either longer.
253254
- menus: could merge draw call in most cases (how about storing an optional aabb in ImDrawCmd to move the burden of merging in a single spot).
255+
- menus: would be nice if the Selectable() supported horizontal alignment (must be given the equivalent of WorkRect.Max.x matching the position of the shortcut column)
254256

255257
- tree node: add treenode/treepush int variants? not there because (void*) cast from int warns on some platforms/settings?
256258
- tree node: try to apply scrolling at time of TreePop() if node was just opened and end of node is past scrolling limits?

examples/README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ example_glfw_opengl2/
206206
GLFW + OpenGL2 example (legacy, fixed pipeline).
207207
= main.cpp + imgui_impl_glfw.cpp + imgui_impl_opengl2.cpp
208208
**DO NOT USE OPENGL2 CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)**
209-
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbindings, you can replace the OpenGL function loader)**
209+
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbinding, you can replace the OpenGL function loader)**
210210
This code is mostly provided as a reference to learn about Dear ImGui integration, because it is shorter.
211211
If your code is using GL3+ context or any semi modern OpenGL calls, using this renderer is likely to
212212
make things more complicated, will require your code to reset many OpenGL attributes to their initial
@@ -255,7 +255,7 @@ example_sdl_opengl2/
255255
SDL2 (Win32, Mac, Linux etc.) + OpenGL example (legacy, fixed pipeline).
256256
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_opengl2.cpp
257257
**DO NOT USE OPENGL2 CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)**
258-
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbindings, you can replace the OpenGL function loader)**
258+
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbinding, you can replace the OpenGL function loader)**
259259
This code is mostly provided as a reference to learn about Dear ImGui integration, because it is shorter.
260260
If your code is using GL3+ context or any semi modern OpenGL calls, using this renderer is likely to
261261
make things more complicated, will require your code to reset many OpenGL attributes to their initial

examples/example_glfw_opengl3/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ CXXFLAGS += -I../libs/gl3w -DIMGUI_IMPL_OPENGL_LOADER_GL3W
4242
# CXXFLAGS += -I../libs/glad/include -DIMGUI_IMPL_OPENGL_LOADER_GLAD
4343

4444
## Using OpenGL loader: glbinding
45-
## (This assumes a system-wide installation)
46-
# CXXFLAGS += -lglbinding -DIMGUI_IMPL_OPENGL_LOADER_GLBINDING
45+
## This assumes a system-wide installation
46+
## of either version 3.0.0 (or newer)
47+
# CXXFLAGS += -lglbinding -DIMGUI_IMPL_OPENGL_LOADER_GLBINDING3
48+
## or the older version 2.x
49+
# CXXFLAGS += -lglbinding -DIMGUI_IMPL_OPENGL_LOADER_GLBINDING2
4750

4851
##---------------------------------------------------------------------
4952
## BUILD FLAGS PER PLATFORM

examples/example_glfw_opengl3/main.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
1212
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
1313
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
1414
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
15-
#include <GL/gl3w.h> // Initialize with gl3wInit()
15+
#include <GL/gl3w.h> // Initialize with gl3wInit()
1616
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
17-
#include <GL/glew.h> // Initialize with glewInit()
17+
#include <GL/glew.h> // Initialize with glewInit()
1818
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
19-
#include <glad/glad.h> // Initialize with gladLoadGL()
20-
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING)
21-
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
22-
#include <glbinding/glbinding.h> // Initialize with glbinding::initialize()
19+
#include <glad/glad.h> // Initialize with gladLoadGL()
20+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
21+
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
22+
#include <glbinding/Binding.h> // Initialize with glbinding::Binding::initialize()
23+
#include <glbinding/gl/gl.h>
24+
using namespace gl;
25+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
26+
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
27+
#include <glbinding/glbinding.h>// Initialize with glbinding::initialize()
2328
#include <glbinding/gl/gl.h>
2429
using namespace gl;
2530
#else
@@ -79,7 +84,10 @@ int main(int, char**)
7984
bool err = glewInit() != GLEW_OK;
8085
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
8186
bool err = gladLoadGL() == 0;
82-
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING)
87+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
88+
bool err = false;
89+
glbinding::Binding::initialize();
90+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
8391
bool err = false;
8492
glbinding::initialize([](const char* name) { return (glbinding::ProcAddress)glfwGetProcAddress(name); });
8593
#else

examples/example_sdl_opengl3/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,11 @@ CXXFLAGS += -I../libs/gl3w -DIMGUI_IMPL_OPENGL_LOADER_GL3W
4242
# CXXFLAGS += -I../libs/glad/include -DIMGUI_IMPL_OPENGL_LOADER_GLAD
4343

4444
## Using OpenGL loader: glbinding
45-
## (This assumes a system-wide installation)
46-
# CXXFLAGS += -lglbinding -DIMGUI_IMPL_OPENGL_LOADER_GLBINDING
45+
## This assumes a system-wide installation
46+
## of either version 3.0.0 (or newer)
47+
# CXXFLAGS += -lglbinding -DIMGUI_IMPL_OPENGL_LOADER_GLBINDING3
48+
## or the older version 2.x
49+
# CXXFLAGS += -lglbinding -DIMGUI_IMPL_OPENGL_LOADER_GLBINDING2
4750

4851
##---------------------------------------------------------------------
4952
## BUILD FLAGS PER PLATFORM

examples/example_sdl_opengl3/main.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
1515
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
1616
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
17-
#include <GL/gl3w.h> // Initialize with gl3wInit()
17+
#include <GL/gl3w.h> // Initialize with gl3wInit()
1818
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
19-
#include <GL/glew.h> // Initialize with glewInit()
19+
#include <GL/glew.h> // Initialize with glewInit()
2020
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
21-
#include <glad/glad.h> // Initialize with gladLoadGL()
22-
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING)
23-
#include <glbinding/glbinding.h> // Initialize with glbinding::initialize()
21+
#include <glad/glad.h> // Initialize with gladLoadGL()
22+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
23+
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
24+
#include <glbinding/Binding.h> // Initialize with glbinding::Binding::initialize()
25+
#include <glbinding/gl/gl.h>
26+
using namespace gl;
27+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
28+
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
29+
#include <glbinding/glbinding.h>// Initialize with glbinding::initialize()
2430
#include <glbinding/gl/gl.h>
2531
using namespace gl;
2632
#else
@@ -73,7 +79,10 @@ int main(int, char**)
7379
bool err = glewInit() != GLEW_OK;
7480
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
7581
bool err = gladLoadGL() == 0;
76-
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING)
82+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
83+
bool err = false;
84+
glbinding::Binding::initialize();
85+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
7786
bool err = false;
7887
glbinding::initialize([](const char* name) { return (glbinding::ProcAddress)SDL_GL_GetProcAddress(name); });
7988
#else

0 commit comments

Comments
 (0)