-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
OpenGL3 backend rendering breaks with GL_PRIMITIVE_RESTART #3544
Comments
Thanks for reporting this. Strictly speaking it technically a “bug” but those are endless as OpenGL is a state machine with hundred of states (made more complicated by the many flavors and versions of GL). As you can see in the backend code we backup/change/restore many state so it would be a matter of adding this to the list of backed up state. (While carefully only calling it for the appropriate GL version) Realistically speaking, if your OpenGL code wants to interact with any other OpenGL code it is most likely to need to restore any state that the foreign code is unaware off, so your solution would work just as well. But we’re happy to add more to the list of restored state in the backend if it helps. |
Yes, I can see how it would be difficult to cover all such situations. I think you should decide yourself if you want to handle this particular case. |
Version: 1.79
Branch: master
Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler: GCC 10.0.1
Operating System: Ubuntu 20.04
If I take the GLFW/OpenGL3 example and add
glEnable(GL_PRIMITIVE_RESTART);
just before the main loop, the result looks like this:The problem does not occur if I wrap my own OpenGL calls in
glEnable(GL_PRIMITIVE_RESTART);
/glDisable(GL_PRIMITIVE_RESTART);
each frame. I'm not experienced with OpenGL so I'm not sure if this is supposed to work like that or if it's a bug in the backend implementation.The text was updated successfully, but these errors were encountered: