-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Wrong scissor clipping when using glClipControl origin GL_UPPER_LEFT #2186
Comments
Hello, Never heard of Since this is so esoteric and using 4.5+ functions may be problematic in the binding, could you just call |
Here is how I ended it:
GLint clip_origin; glGetIntegerv(GL_CLIP_ORIGIN, &clip_origin);
|
Can't find it in the docs of khronos.org but apparently there is a GL_CLIP_ORIGIN to be used with glGet()
|
See my update. I don't frequently update imgui so I just fixed it inside that file.But maybe for the future uses it should be added via state query as you do with the rest of params. |
My suggest above was to change the clip control on your side so you don't modify imgui's code. This is only going to reduce your update flexibility. I have now added support for it in imgui_impl_opengl3.cpp (untested). |
I see what you mean,but in my code I try to hide OpenGL details as much as possible ,and because imgui is used just for debug tasks and the rest of the rendering system uses UPPER_LEFT origin mode,in my case I found it more suitable to put inside that rendering backend file. But if you want my opinion so I would just do it as you do with the rest of the state.Just query that clip state and then either change the state during imgui pass or change the clipping rectangle.I hate changing states too much so I went with the second one . |
Hello @MichaelSSky , |
Hi!
In my app I set glClipControl origin to be GL_UPPER_LEFT to match D3D screen space coordinated.It effectively flips frame buffer attachment along Y axis .And I see that imgui GL backend uses inverted scissor rectangle ,and in this case the ui gets cut in wrong places.
My imgui version (v1.60 WIP) is a bit old so I made the following change to make it work:
imgui_impl_opengl3.cpp
The text was updated successfully, but these errors were encountered: