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

GLFW - example integration on Osx breaks OpenGL state #2366

Closed
sadovsf opened this issue Feb 19, 2019 · 9 comments
Closed

GLFW - example integration on Osx breaks OpenGL state #2366

sadovsf opened this issue Feb 19, 2019 · 9 comments

Comments

@sadovsf
Copy link

sadovsf commented Feb 19, 2019

Hello recently i updated my ancient version of ImGUI i was using to current one Tagged as 1.68 in git (commit: 3c15dff). With that i discovered after integrating with my engine. That there is one call which causes OpenGL to cry about unknown enum value (Error 500). Piece of code that is causing this issue is:

glGetIntegerv(GL_CLIP_ORIGIN, (GLint*)&last_clip_origin); // Support for GL 4.5's glClipControl(GL_UPPER_LEFT)

From example integration for OpenGL3. When i remove this everything runs well. Iam using GLFW with already mentioned OpenGL3 on Osx Mojave (Latest update). Also i was not able to find glGetIntegerv documentation allowing enum value GL_CLIP_ORIGIN as parameter so maybe it is even bug.

@ocornut
Copy link
Owner

ocornut commented Feb 19, 2019

GL_CLIP_ORIGIN may not be supported on Osx Mojave.
I presume the define comes from gl3w.h , so we have a problem here and need to find another way to detect support (e.g. query OpenGL version?) Do you have a suggestion?

Linking to #2186.

@sadovsf
Copy link
Author

sadovsf commented Feb 19, 2019

Sure, version could work or for time being as Apple is not going to support much OpenGL any further it should be quite safe to disable for Osx generally (we are still on something like v3.3). Also question is if this should even be in OpenGL3 example as it is 4.5 feature

@ocornut
Copy link
Owner

ocornut commented Feb 19, 2019

it should be quite safe to disable for Osx generally (we are still on something like v3.3)

That should do the trick.

Also question is if this should even be in OpenGL3 example as it is 4.5 feature

The file is kind of misnamed as it support wide range of versions, will rename to imgui_impl_gl at some point.

@sadovsf
Copy link
Author

sadovsf commented Feb 19, 2019

Also maybe important piece of info, i'am using IMGUI_IMPL_OPENGL_LOADER_GLEW

@sadovsf
Copy link
Author

sadovsf commented Feb 19, 2019

Perfect, should i make pull request or you will do the change?

@ocornut
Copy link
Owner

ocornut commented Feb 19, 2019

Hello,
I can add the ifdef, but I'll like to to hunt for a few more confirmation that 4.5 functions are not accessible on OSX (sorry if this sound naive/dumb! I don't know much about either tech!). Asked the author of the previous issue tht led to issue, if you have more reference to share it would help.

@sadovsf
Copy link
Author

sadovsf commented Feb 20, 2019

I fully understand that. Here is some more info about ogl on osx:
https://www.google.com/amp/s/appleinsider.com/articles/18/06/04/opengl-opencl-deprecated-in-favor-of-metal-2-in-macos-1014-mojave/amp/

https://www.forums.fusionfalluniverse.com/index.php?topic=15145.0

And yes it looks like we will have to use some wrapper above rendering tech like bgfx in the future to have multiplatform rendering solution which sucks 😕

@MichaelSSky
Copy link

AFAIK the method is not supported on OS X due to the lack of support for OpenGL 4.5

@ocornut
Copy link
Owner

ocornut commented Feb 20, 2019

Thank you both, I have applied the fix for it now!

@ocornut ocornut closed this as completed Feb 20, 2019
ocornut added a commit that referenced this issue Feb 20, 2019
… to read GL_CLIP_ORIGIN even if the OpenGL headers/loader happens to define the value. (#2366, #2186)
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

3 participants