You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back-ends: imgui_impl_opengl2.cpp + imgui_impl_glfw.cpp
Compiler: Visual Studio 2019
Operating System: Windows 10
My Issue/Question:
Using an OpenGL loader with this configuration (opengl2 + glfw + glbinding in my specific case) leads to multiple inclusion of OpenGL functions.
Commenting #include <GL/gl.h> in imgui_impl_opengl2.cpp was working when including the files directly in the project, but with vcpkg it's not an option anymore.
In imgui_impl_opengl3.cpp various defines (like IMGUI_IMPL_OPENGL_LOADER_GLBINDING2) are used to automatically handle the loaders, maybe something similar yet simpler could be applied in the present case ?
I'm not sure of the right way to do this (reuse an existing define, create a new one, something else ?).
Relevant code in imgui_impl_opengl2.cpp :
// Include OpenGL header (without an OpenGL loader) requires a bit of fiddling
#if defined(_WIN32) && !defined(APIENTRY)
#define APIENTRY __stdcall // It is customary to use APIENTRY for OpenGL function pointer declarations on all platforms. Additionally, the Windows OpenGL header needs APIENTRY.
#endif
#if defined(_WIN32) && !defined(WINGDIAPI)
#define WINGDIAPI __declspec(dllimport) // Some Windows OpenGL headers need this
#endif
#if defined(__APPLE__)
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
Here's my declaration :
#include <glbinding/gl21/gl.h>
#include <glbinding/gl21ext/gl.h>
#include <glbinding/glbinding.h>
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl2.h>
#include <GLFW/glfw3.h>
using namespace gl21;
using namespace gl21ext;
And the error message :
Thanks for reading me :)
The text was updated successfully, but these errors were encountered:
If I have to be honest, dealing with OpenGL loaders seems like a never-ending quagmire of issues :( and at some point we should leave it to users to copy and paste those files. It's not my responsibility if vcpkg decide to package libraries that are not designed to be packaged, but I'm willing to help fix things if we can do it with reasonable effort.
HOWEVER
I must state that imgui_impl_opengl2 and imgui_impl_opengl3 are incorrectly named.
If you are using glbinding/ with a 2.1 context you may be able to use imgui_impl_opengl3. Can you investigate this path?
I'll investigate this path for sure .. actually I already did that a bit in the past (check issue #1513), but I'm no longer in possession of the laptop that triggered the original problem, so I guess I'll be just as good to forget opengl2 now :)
Version/Branch of Dear ImGui:
Version: 1.79 (through vcpkg)
Branch: master
Back-end/Renderer/Compiler/OS
Back-ends: imgui_impl_opengl2.cpp + imgui_impl_glfw.cpp
Compiler: Visual Studio 2019
Operating System: Windows 10
My Issue/Question:
Using an OpenGL loader with this configuration (opengl2 + glfw + glbinding in my specific case) leads to multiple inclusion of OpenGL functions.
Commenting
#include <GL/gl.h>
in imgui_impl_opengl2.cpp was working when including the files directly in the project, but with vcpkg it's not an option anymore.In imgui_impl_opengl3.cpp various defines (like IMGUI_IMPL_OPENGL_LOADER_GLBINDING2) are used to automatically handle the loaders, maybe something similar yet simpler could be applied in the present case ?
I'm not sure of the right way to do this (reuse an existing define, create a new one, something else ?).
Relevant code in imgui_impl_opengl2.cpp :
Here's my declaration :
And the error message :
Thanks for reading me :)
The text was updated successfully, but these errors were encountered: