Skip to content

Commit f2b01c3

Browse files
committed
Changelog, tweak OpenGL3 backends. (ocornut#3061), update Gallery thread links.
1 parent ac4262a commit f2b01c3

File tree

9 files changed

+55
-49
lines changed

9 files changed

+55
-49
lines changed

docs/CHANGELOG.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Other Changes:
6868
- CI: Added more tests on the continuous-integration server: extra warnings for Clang/GCC, building
6969
SDL+Metal example, building imgui_freetype.cpp, more compile-time imconfig.h settings: disabling
7070
obsolete functions, enabling 32-bit ImDrawIdx, enabling 32-bit ImWchar, disabling demo. [@rokups]
71+
- Backends: OpenGL3: Added include support for older glbinding 2.x loader. (#3061) [@DonKult]
7172
- Backends: Win32: Added ImGui_ImplWin32_EnableDpiAwareness(), ImGui_ImplWin32_GetDpiScaleForHwnd(),
7273
ImGui_ImplWin32_GetDpiScaleForMonitor() helpers functions (backported from the docking branch).
7374
Those functions makes it easier for example apps to support hi-dpi features without setting up
@@ -172,7 +173,7 @@ Other Changes:
172173
- Examples: OpenGL: Explicitly adding -DIMGUI_IMPL_OPENGL_LOADER_GL3W to Makefile to match linking
173174
settings (otherwise if another loader such as Glew is accessible, the OpenGL3 backend might
174175
automatically use it). (#2919, #2798)
175-
- Examples: OpenGL: Added support for glbindings OpenGL loader. (#2870) [@rokups]
176+
- Examples: OpenGL: Added support for glbinding OpenGL loader. (#2870) [@rokups]
176177
- Examples: Emscripten: Demonstrating embedding fonts in Makefile and code. (#2953) [@Oipo]
177178
- Examples: Metal: Wrapped main loop in @autoreleasepool block to ensure allocations get freed
178179
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
-----------

examples/README.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ example_glfw_opengl2/
199199
GLFW + OpenGL2 example (legacy, fixed pipeline).
200200
= main.cpp + imgui_impl_glfw.cpp + imgui_impl_opengl2.cpp
201201
**DO NOT USE OPENGL2 CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)**
202-
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbindings, you can replace the OpenGL function loader)**
202+
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbinding, you can replace the OpenGL function loader)**
203203
This code is mostly provided as a reference to learn about Dear ImGui integration, because it is shorter.
204204
If your code is using GL3+ context or any semi modern OpenGL calls, using this renderer is likely to
205205
make things more complicated, will require your code to reset many OpenGL attributes to their initial
@@ -248,7 +248,7 @@ example_sdl_opengl2/
248248
SDL2 (Win32, Mac, Linux etc.) + OpenGL example (legacy, fixed pipeline).
249249
= main.cpp + imgui_impl_sdl.cpp + imgui_impl_opengl2.cpp
250250
**DO NOT USE OPENGL2 CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)**
251-
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbindings, you can replace the OpenGL function loader)**
251+
**Prefer using OPENGL3 code (with gl3w/glew/glad/glbinding, you can replace the OpenGL function loader)**
252252
This code is mostly provided as a reference to learn about Dear ImGui integration, because it is shorter.
253253
If your code is using GL3+ context or any semi modern OpenGL calls, using this renderer is likely to
254254
make things more complicated, will require your code to reset many OpenGL attributes to their initial

examples/example_glfw_opengl3/main.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +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_GLBINDING2) || defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
21-
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
22-
#if defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
23-
#include <glbinding/Binding.h> // Initialize with glbinding::Binding::initialize()
24-
#else
25-
#include <glbinding/glbinding.h> // Initialize with glbinding::initialize()
26-
#endif
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()
2728
#include <glbinding/gl/gl.h>
2829
using namespace gl;
2930
#else

examples/example_sdl_opengl3/main.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +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_GLBINDING2) || defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
23-
#if defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
24-
#include <glbinding/Binding.h> // Initialize with glbinding::Binding::initialize()
25-
#else
26-
#include <glbinding/glbinding.h> // Initialize with glbinding::initialize()
27-
#endif
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()
2830
#include <glbinding/gl/gl.h>
2931
using namespace gl;
3032
#else

examples/imgui_impl_opengl3.cpp

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
// CHANGELOG
1515
// (minor and older changes stripped away, please see git history for details)
16-
// 2020-01-07: OpenGL: Added support for glbindings OpenGL loader.
16+
// 2020-03-24: OpenGL: Added support for glbinding 2.x OpenGL loader.
17+
// 2020-01-07: OpenGL: Added support for glbinding 3.x OpenGL loader.
1718
// 2019-10-25: OpenGL: Using a combination of GL define and runtime GL version to decide whether to use glDrawElementsBaseVertex(). Fix building with pre-3.2 GL loaders.
1819
// 2019-09-22: OpenGL: Detect default GL loader using __has_include compiler facility.
1920
// 2019-09-16: OpenGL: Tweak initialization code to allow application calling ImGui_ImplOpenGL3_CreateFontsTexture() before the first NewFrame() call.
@@ -83,22 +84,19 @@
8384
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3)
8485
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__))
8586
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
86-
#undef IMGUI_IMPL_OPENGL_LOADER_GL3W
87-
#undef IMGUI_IMPL_OPENGL_LOADER_GLEW
88-
#undef IMGUI_IMPL_OPENGL_LOADER_GLAD
89-
#undef IMGUI_IMPL_OPENGL_LOADER_GLBINDING2
90-
#undef IMGUI_IMPL_OPENGL_LOADER_GLBINDING3
91-
#undef IMGUI_IMPL_OPENGL_LOADER_CUSTOM
9287
#elif defined(__EMSCRIPTEN__)
9388
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
89+
#endif
90+
#endif
91+
92+
#if defined(IMGUI_IMPL_OPENGL_ES2) || defined(IMGUI_IMPL_OPENGL_ES3)
9493
#undef IMGUI_IMPL_OPENGL_LOADER_GL3W
9594
#undef IMGUI_IMPL_OPENGL_LOADER_GLEW
9695
#undef IMGUI_IMPL_OPENGL_LOADER_GLAD
9796
#undef IMGUI_IMPL_OPENGL_LOADER_GLBINDING2
9897
#undef IMGUI_IMPL_OPENGL_LOADER_GLBINDING3
9998
#undef IMGUI_IMPL_OPENGL_LOADER_CUSTOM
10099
#endif
101-
#endif
102100

103101
// GL includes
104102
#if defined(IMGUI_IMPL_OPENGL_ES2)
@@ -115,18 +113,20 @@
115113
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
116114
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
117115
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
118-
#include <GL/gl3w.h> // Needs to be initialized with gl3wInit() in user's code
116+
#include <GL/gl3w.h> // Needs to be initialized with gl3wInit() in user's code
119117
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
120-
#include <GL/glew.h> // Needs to be initialized with glewInit() in user's code
118+
#include <GL/glew.h> // Needs to be initialized with glewInit() in user's code.
121119
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
122-
#include <glad/glad.h> // Needs to be initialized with gladLoadGL() in user's code
123-
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2) || defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
124-
#include <glbinding/gl/gl.h> // Initialize with glbinding::initialize()
125-
#if defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
126-
#include <glbinding/Binding.h>
127-
#else
128-
#include <glbinding/glbinding.h>
129-
#endif
120+
#include <glad/glad.h> // Needs to be initialized with gladLoadGL() in user's code.
121+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING2)
122+
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
123+
#include <glbinding/Binding.h> // Needs to be initialized with glbinding::Binding::initialize() in user's code.
124+
#include <glbinding/gl/gl.h>
125+
using namespace gl;
126+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
127+
#define GLFW_INCLUDE_NONE // GLFW including OpenGL headers causes ambiguity or multiple definition errors.
128+
#include <glbinding/glbinding.h>// Needs to be initialized with glbinding::initialize() in user's code.
129+
#include <glbinding/gl/gl.h>
130130
using namespace gl;
131131
#else
132132
#include IMGUI_IMPL_OPENGL_LOADER_CUSTOM
@@ -203,8 +203,10 @@ bool ImGui_ImplOpenGL3_Init(const char* glsl_version)
203203
gl_loader = "glbinding2";
204204
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLBINDING3)
205205
gl_loader = "glbinding3";
206-
#else // IMGUI_IMPL_OPENGL_LOADER_CUSTOM
207-
gl_loader = "Custom";
206+
#elif defined(IMGUI_IMPL_OPENGL_LOADER_CUSTOM)
207+
gl_loader = "custom";
208+
#else
209+
gl_loader = "none";
208210
#endif
209211

210212
// Make a dummy GL call (we don't actually need the result)

imgui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// - FAQ http://dearimgui.org/faq
1111
// - Homepage & latest https://github.com/ocornut/imgui
1212
// - Releases & changelog https://github.com/ocornut/imgui/releases
13-
// - Gallery https://github.com/ocornut/imgui/issues/2847 (please post your screenshots/video there!)
13+
// - Gallery https://github.com/ocornut/imgui/issues/3075 (please post your screenshots/video there!)
1414
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
1515
// - Wiki https://github.com/ocornut/imgui/wiki
1616
// - Issues & support https://github.com/ocornut/imgui/issues
@@ -783,7 +783,7 @@ CODE
783783
- If you are experienced with Dear ImGui and C++, look at the github issues, look at the Wiki, read docs/TODO.txt
784784
and see how you want to help and can help!
785785
- Disclose your usage of Dear ImGui via a dev blog post, a tweet, a screenshot, a mention somewhere etc.
786-
You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/2847). Visuals are ideal as they inspire other programmers.
786+
You may post screenshot or links in the gallery threads (github.com/ocornut/imgui/issues/3075). Visuals are ideal as they inspire other programmers.
787787
But even without visuals, disclosing your use of dear imgui help the library grow credibility, and help other teams and programmers with taking decisions.
788788
- 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 (on github or privately).
789789

imgui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// - FAQ http://dearimgui.org/faq
1212
// - Homepage & latest https://github.com/ocornut/imgui
1313
// - Releases & changelog https://github.com/ocornut/imgui/releases
14-
// - Gallery https://github.com/ocornut/imgui/issues/2847 (please post your screenshots/video there!)
14+
// - Gallery https://github.com/ocornut/imgui/issues/3075 (please post your screenshots/video there!)
1515
// - Glossary https://github.com/ocornut/imgui/wiki/Glossary
1616
// - Wiki https://github.com/ocornut/imgui/wiki
1717
// - Issues & support https://github.com/ocornut/imgui/issues

0 commit comments

Comments
 (0)