mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-01 05:10:41 +00:00
Manage OpenGL loader in opengl2 back-end #3736
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#3736
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 :)
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?Wow ... you're lightning fast to answer :)
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 :)
Thanks for your reply.
Changing calls to use imgui_impl_opengl3 works fine when defining
#define GLFW_INCLUDE_NONE.I guess that's it for this one :)