5
$\begingroup$

I'm programming on a Mac and I'm learning OpenGL in the library GLFW.

My problem is that my Mac supports OpenGL up to version 4.1, but when I try to compile the shaders with version 410 it says ERROR: 0:1: '' : version '410' is not supported.

How do I set the version that GLFW should use?

$\endgroup$
1
  • $\begingroup$ you can use glGetString(GL_SHADING_LANGUAGE_VERSION) to see which glsl versions are available to you. printf("Supported GLSL version is %s.\n", (char *)glGetString(GL_SHADING_LANGUAGE_VERSION)); $\endgroup$
    – Senne
    Commented Dec 29, 2015 at 15:10

1 Answer 1

1
$\begingroup$

Changed the core profile to 3.2 by setting the window hints.

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
$\endgroup$
2
  • 1
    $\begingroup$ Kinda looks like you changed it to 3.2. $\endgroup$
    – Rotem
    Commented Dec 28, 2015 at 7:35
  • $\begingroup$ Well, in my code its 4.1 haha $\endgroup$ Commented Dec 28, 2015 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.