-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup OpenGL 3 loader detection #3246
Conversation
Hello @funchal and thanks for the PR. You are right most of this doesn't need to be in the header file. Prior to #2798 this block only had a few #ifdef and #defines. Could you:
Thank you! |
c451362
to
2e2c962
Compare
Thank you so much for taking the time to review this. I have applied your suggestions. dear imgui is awesome, I've been a user for absolutely ages and I'm happy that I finally found a little time to try to contribute. |
Thank you! Well, bad news ahead :/ Also note that |
Yes, I agree. However, note that when imgui/examples/imgui_impl_opengl3.cpp Lines 124 to 131 in 2e2c962
This is what bothered me originally. In my case I use ES2 so I had to define So let me suggest one more thing. Perhaps what we should do is move the code for imgui/examples/imgui_impl_opengl3.cpp Lines 115 to 122 in 2e2c962
In other words, basically the header file would have this (in order):
|
I agree yes. Seems like this was overlooked when adding the auto-detection macros.
|
2e2c962
to
871269b
Compare
Yes, I think this is better. Updated. |
Merged with minor tweaks (moved comments below to prioritize important contents of imgui_impl_opengl3.h) |
OpenGL 3 backend header has some logic to auto-detect the GL loader, however that is only necessary for the implementation in the cpp, not in the header. This change moves the code from the header to the cpp. This avoids unnecessary global macro pollution as well as potential for mistakes since previously
IMGUI_IMPL_OPENGL_LOADER_*
andIMGUI_IMPL_OPENGL_*
would have to have consistent values every timeimgui_impl_opengl3.h
was included.