Question regarding OpenGL and macOS

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Sadman
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Oct 06, 2022 7:04 am

Question regarding OpenGL and macOS

Post by Sadman »

Hello,
Since macOS does not support OpenGL, does it mean that wxWidgets OpenGL applications do not work on macOS?

Thank you.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Question regarding OpenGL and macOS

Post by ONEEYEMAN »

Hi,
Which OSX do you have installed?

OSX does support OpenGL just like any other *nix.

Thank you.
Manolo
Can't get richer than this
Can't get richer than this
Posts: 828
Joined: Mon Apr 30, 2012 11:07 pm

Re: Question regarding OpenGL and macOS

Post by Manolo »

As oneeyeman told, OSX does support OpenGL.
The thing is that they have deprecated OpenGL in favor of their own Metal API. "deprecated" is not the same as "removed". I doubt OSX would remobe OGL in the next years. But with macOS you never know.

The last OGL version they supported (but still available) is 4.1. Currently using wxWidgets for OSX, with no effort on your own, you can ask for OGL 3.2. If you need 4.1 yes or yes, then I can guide you on how to set proper attributes in wxGLContext.
Sadman
In need of some credit
In need of some credit
Posts: 2
Joined: Thu Oct 06, 2022 7:04 am

Re: Question regarding OpenGL and macOS

Post by Sadman »

Thank you for your replies.

So it means OpenGL applications will work, but I cannot utilize features added after OpenGL 4.1?
Manolo
Can't get richer than this
Can't get richer than this
Posts: 828
Joined: Mon Apr 30, 2012 11:07 pm

Re: Question regarding OpenGL and macOS

Post by Manolo »

I cannot utilize features added after OpenGL 4.1?
Correct.
To use features for, say, OGL 4.5 you need to ask for this 4.5 version when you set parameters of wxGLContext.
But these parameters have no effect in OSX, and you will get just OGL 3.2 version (or, as I told before, you can ask up to 4.1)

If your OGL code (shaders, etc) uses 4.5 features, you will get OGL errors. Not a crash, but nothing drawn.
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7478
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Question regarding OpenGL and macOS

Post by ONEEYEMAN »

Manolo,
Are you familiar with OSX? Maybe it makes sense to use Metal API in OSX port?

Thank you.
Manolo
Can't get richer than this
Can't get richer than this
Posts: 828
Joined: Mon Apr 30, 2012 11:07 pm

Re: Question regarding OpenGL and macOS

Post by Manolo »

Igor, no I don't develop for OSX. But I've read a lot :wink:

Metal is an OSX-only API. People using it are likely not using wx.

The future-standard for all OS's, by now, is called "Vulcan". Much more complex that OpenGL, more high-power, more control. So it's mainly used for extreme-necessities. And yes, perhaps some day a wx-vulcan support may be good.
Post Reply