Hello Guest

OpenGL Capabilities - Mac OS El Capitan

  • 2 Replies
  • 4165 Views
OpenGL Capabilities - Mac OS El Capitan
« on: October 23, 2015, 12:53:06 »
Hello Guys,

I was playing with lwjgl today and got the error "This functionality is not available." when calling "GL30.glGenVertexArrays()" .

Indeed, until recently Mac OS X would only support OpenGL 2.1. However, after updating to El Capitan my computer reports to me that it now supports OpenGL 4.1 (I used an application called OpenGL Extension Viewer to check this).

(MacBook Retina late 2012, Graphics: Intel Iris, OpenGL Version: 4.1 INTEL-10.8.77)

I am a bit confused. Isn't this function a core function?

Do lwjgl bindings have access to the latest functionalities on Mac OS X El Capitan?







*

Kai

Re: OpenGL Capabilities - Mac OS El Capitan
« Reply #1 on: October 23, 2015, 13:00:08 »
On OS X one has to (and always had to) explicitly request a core context. Otherwise one would get an "old" 2.1 context.

LWJGL3:
Code: [Select]
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);

LWJGL2:
Code: [Select]
PixelFormat pixelFormat = new PixelFormat();
ContextAttribs contextAtrributes = new ContextAttribs(4, 1)
    .withForwardCompatible(true)
    .withProfileCore(true);
Display.create(pixelFormat, contextAtrributes);

Re: OpenGL Capabilities - Mac OS El Capitan
« Reply #2 on: October 23, 2015, 13:03:55 »
Big thanks for the ultra-quick answer!