Mac OS 10.14 Mojave was just released, and since June, we've known that OpenGL was to be deprecated in the OS. "OpenGL applications will continue to run, but you should switch to Metal," to paraphrase. However, there doesn't seem to be any documentation indicating whether you can still compile with OpenGL or if Apple prevents that or omits the proper development libraries. I am currently developing an OpenGL-based graphics program and cannot risk updating if compilation will no longer work. Has anyone tested this?
EDIT: Does anyone else share Esenthel's experience?
Built-in OpenGL on macOS works a little bit different from other platforms like Windows or Linux. On Windows, system-provided opengl32. dll doesn't actually implement OpenGL but is rather a proxy-library dynamically loading functions from a driver provided by a graphics card vendor.
As a result, we will officially deprecate the OpenGL graphics API for macOS platforms in the 22.2 release, and Unity 2022.2's system requirements increase the minimum required macOS version to 10.14 for both the Editor and the Player. We are going to remove OpenGL support for macOS entirely in Unity 2023.1.
I can compile, however after updating to latest Mojave and Xcode, my OpenGL applications simply don't work.
In one case I get a hang during a system GL call, in another case just a black screen. And some errors in the output same as here: https://stackoverflow.com/questions/52507950/unable-to-load-info-plist-error-xcode-10-under-macos-10-14-mojave#=
I recommend that you don't update.
I think there's something broken in Xcode 10 OpenGL libraries.
Edit: It appears that later Mac OS and Xcode updates have fixed the problems.
GLFW work around. Similar to other answers, but you do not need to resize your window in the draw loop, just call glfwPollEvents()
first.
window = glfwCreateWindow(width-1, height, "Hello World", NULL, NULL);
glfwPollEvents();
glfwSetWindowSize(window, width, height);
Also, glfwHideWindow()
then glfwShowWindow()
seems to work. Similarly glfwSetWindowPos()
is an alternative. Though setting the window size seems faster than hide/showing the window, and I don't want to move the window position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With