Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mac Mojave + opengl

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?

like image 258
synchronizer Avatar asked Sep 26 '18 03:09

synchronizer


People also ask

Is OpenGL supported on macOS?

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.

Will OpenGL be removed from macOS?

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.


2 Answers

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.

like image 179
Esenthel Avatar answered Nov 02 '22 01:11

Esenthel


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.

like image 28
Daniel Schwartz Avatar answered Nov 02 '22 02:11

Daniel Schwartz