Fix `Error 65543: NSGL` on macOS

## Forward compatibility (GLFW_OPENGL_FORWARD_COMPAT)
Fix for error 65543 on macOS:
Error `65543`: NSGL: The targeted version of OS X only supports forward-compatible contexts for OpenGL 3.2 and above

Quote from docs:
GLFW_OPENGL_FORWARD_COMPAT specifies whether the OpenGL context should be forward-compatible, i.e. one where all functionality deprecated in the requested version of OpenGL is removed. This must only be used if the requested OpenGL version is 3.0 or above.
master
Jupiter 2018-04-11 14:40:18 +03:00 committed by GitHub
parent bca152011e
commit b3b0c9ee02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -410,6 +410,7 @@ int main(int argc, char *argv[])
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
win = glfwCreateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, "Demo", NULL, NULL);
glfwMakeContextCurrent(win);
glfwSetWindowUserPointer(win, &ctx);