GLFW - example integration on Osx breaks OpenGL state #2366

Closed
opened 2019-02-19 21:36:18 +00:00 by sadovsf · 9 comments
sadovsf commented 2019-02-19 21:36:18 +00:00 (Migrated from github.com)

Hello recently i updated my ancient version of ImGUI i was using to current one Tagged as 1.68 in git (commit: 3c15dffc94). 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.

Hello recently i updated my ancient version of ImGUI i was using to current one Tagged as 1.68 in git (commit: 3c15dffc944419eb4bb17984548468270ca90486). 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 commented 2019-02-19 21:41:46 +00:00 (Migrated from github.com)

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.

`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 commented 2019-02-19 21:45:24 +00:00 (Migrated from github.com)

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

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 commented 2019-02-19 21:50:42 +00:00 (Migrated from github.com)

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.

> 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 commented 2019-02-19 21:53:42 +00:00 (Migrated from github.com)

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

Also maybe important piece of info, i'am using IMGUI_IMPL_OPENGL_LOADER_GLEW
sadovsf commented 2019-02-19 21:54:56 +00:00 (Migrated from github.com)

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

Perfect, should i make pull request or you will do the change?
ocornut commented 2019-02-19 23:59:00 +00:00 (Migrated from github.com)

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.

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 commented 2019-02-20 06:17:19 +00:00 (Migrated from github.com)

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 😕

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 commented 2019-02-20 10:05:11 +00:00 (Migrated from github.com)

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

AFAIK the method is not supported on OS X due to the lack of support for OpenGL 4.5
ocornut commented 2019-02-20 13:31:43 +00:00 (Migrated from github.com)

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

Thank you both, I have applied the fix for it now!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#2366
No description provided.