Skip to content
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

#3998 breaks GL_CLIP_ORIGIN on OpenGL contexts < 4.5 #4170

Closed
u3shit opened this issue May 24, 2021 · 5 comments
Closed

#3998 breaks GL_CLIP_ORIGIN on OpenGL contexts < 4.5 #4170

u3shit opened this issue May 24, 2021 · 5 comments

Comments

@u3shit
Copy link
Contributor

u3shit commented May 24, 2021

I just updated to ImGui 1.83 from 1.79, and my gui is upside down again :(

Since #3998 GL_CLIP_ORIGIN is only checked for opengl contexts >= 4.5, but my application actually request 3.3 context and uses the GL_ARB_clip_control extension, which defines the same function and enum values as OpenGL 4.5. (And for example, the nvidia driver gives me a 3.3 core context, where the gui is now upside down and buggy, but the intel driver gives me a 4.5 core context, and everything is fine...)

Unfortunately the opengl backend doesn't parse the list of extensions, so it'd either have to do that, or use the info from the loader (most loaders expose this info, but in a different way). I'm not sure how widespread this functionality in the wild, but seeing how much trouble it causes, I would be even okay with a solution where the backend doesn't try to figure this out on its own, and instead ImGui_ImplOpenGL3_RenderDrawData receives an extra bool parameter (basically the current current_clip_origin variable, default to true so normal GL apps continue to work). Not sure what is the best solution.

Version/Branch of Dear ImGui:

Version: 1.83
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Operating System: Linux

@ocornut
Copy link
Owner

ocornut commented May 24, 2021

Hello,
Thanks for opening this.
I guess we should work out a way to check for GL_ARB_clip_control in the backend, that would be simpler and more correct.

@ocornut
Copy link
Owner

ocornut commented May 24, 2021

Could you run code of that sort:
https://www.geeks3d.com/20100722/tips-how-to-get-the-list-of-the-opengl-extensions-with-a-core-profile/
With both drivers, and confirm that GL_ARB_clip_control is listed in both cases?

@u3shit
Copy link
Contributor Author

u3shit commented May 24, 2021

Yes, I checked, and I have the GL_ARB_clip_control extension listed both with the nvidia and intel driver (and even with osmesa, but that also creates a 4.5 context).

ocornut added a commit that referenced this issue May 24, 2021
…clip_control" extension is detected. (#4170, #3998)

Expecting this to somehow cause another issue but we will fix it when it comes.
@ocornut
Copy link
Owner

ocornut commented May 24, 2021

Pushed a fix for it.
GL being GL I expect one of those new call to fail on some obscure setup, and we'll also fix what once detected.

@ocornut ocornut closed this as completed May 24, 2021
@u3shit
Copy link
Contributor Author

u3shit commented May 24, 2021

Thanks, it looks like it's working with both cards I can test with.
Now figure out what to do with my old column api based property editor...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants