kons-9 icon indicating copy to clipboard operation
kons-9 copied to clipboard

kons-9 is using opengl v4.6 on Linux and opengl v2.1 on macos which are fundamentally incompatible versions

Open awolven opened this issue 1 year ago • 6 comments

awolven avatar Sep 08 '22 05:09 awolven

I came across this:

https://stackoverflow.com/questions/65802625/develop-using-opengl-4-x-on-osx-big-sur

kaveh808 avatar Sep 08 '22 07:09 kaveh808

well it shouldn't be hard to limit to 4.1 until something like this is drop in replacement. https://github.com/openglonmetal/MGL

JMC-design avatar Sep 08 '22 16:09 JMC-design

(glfw:with-init-window (:title "kons-9" :width (first window-size) :height (second window-size) :context-version-major 4 :context-version-minor 1 :opengl-forward-compat t :opengl-profile :opengl-core-profile)

...)

On Thu, Sep 8, 2022 at 11:17 AM Johannes Martinez Calzada < @.***> wrote:

well it shouldn't be hard to limit to 4.1 until something like this is drop in replacement. https://github.com/openglonmetal/MGL

— Reply to this email directly, view it on GitHub https://github.com/kaveh808/kons-9/issues/93#issuecomment-1240934538, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABGMMNPDJE2UFRXWSL7VRTV5IGQNANCNFSM6AAAAAAQHLUZJU . You are receiving this because you authored the thread.Message ID: @.***>

awolven avatar Sep 08 '22 19:09 awolven

Is there a way of getting our existing OpenGL code working with 4.1 on MacOS? If not, what changes are necessary?

I tried the above snippet and got:

An unhandled error condition has been signalled:
   OpenGL signalled (1282 . INVALID-OPERATION) from MATRIX-MODE.

Found this link: https://stackoverflow.com/questions/48249518/opengl-error-1282-invalid-operation-when-using-glut-3-2-core-profile

Tried some other flags, including :opengl-profile :opengl-compat-profile but got:

An unhandled error condition has been signalled:
   NSGL: The targeted version of macOS only supports forward-compatible core profile contexts for OpenGL 3.2 and above

kaveh808 avatar Sep 08 '22 20:09 kaveh808

Looks like Apple does not support deprecated OpenGL past 3.2:

https://www.khronos.org/opengl/wiki/Legacy_OpenGL

So we will have to rewrite all our graphics code (which we were planning to anyway) to move to 4.1.

The question now is what is the best platform to target -- OpenGL 4.1, Vulkan, etc.

In the meantime, we'll keep MacOS at 2.1 and use different versions of Andrew's text engine for MacOS and Linux.

kaveh808 avatar Sep 08 '22 21:09 kaveh808

This might be an opportunity to abstract the rendering "backend". Should you spend your time chasing bugs in compatibility hacks or work up front on a flexible architecture that supports either OpenGL or Metal (etc.) directly? Remember you are interacting with a scene graph, which already is an important abstraction towards this approach. SGI's Open Inventor (while at times a little too "conjoined" with OpenGL and X windows) took such an approach.

ghost avatar Sep 09 '22 16:09 ghost