I want to use OpenGL 3.2 features (e.g. VAOs) on Mac OS X 10.8. But i don't get a 3.2 context. The following lines...
PixelFormat pixelFormat = new PixelFormat();
ContextAttribs contextAtrributes = new ContextAttribs(3, 2);
contextAtrributes.withProfileCompatibility(false);
contextAtrributes.withProfileCore(true);
Display.setDisplayMode(new DisplayMode(width, height));
Display.create(pixelFormat, contextAtrributes);
System.out.println("OS name " + System.getProperty("os.name"));
System.out.println("OS version " + System.getProperty("os.version"));
System.out.println("LWJGL version " + org.lwjgl.Sys.getVersion());
System.out.println("OpenGL version " + glGetString(GL_VERSION));
result in:
OS name Mac OS X
OS version 10.8
LWJGL version 2.8.4
OpenGL version 2.1 NVIDIA-8.0.51
What is the reason why i can't use 3.2? Due to http://lwjgl.org/forum/index.php/topic,4071.0.html (http://lwjgl.org/forum/index.php/topic,4071.0.html) support for OpenGL 3.2 was added.
Thanks very much...
simply passing the following context attribs should work:
new ContextAttribs(3, 2).withProfileCore(true)
Thanks for your answer, it works very well but i'm confused. ???
What is the difference between:
[...]
ContextAttribs contextAtrributes = new ContextAttribs(3, 2).withProfileCore(true);
[...]
Display.create(pixelFormat, contextAtrributes);
[...]
and:
[...]
ContextAttribs contextAtrributes = new ContextAttribs(3, 2);
contextAtrributes.withProfileCore(true);
[...]
Display.create(pixelFormat, contextAtrributes);
[...]
Why does the second approach not work?
ContextAttribs is an immutable class. Every time you call a with<Whatever> method, a new instance is returned.
Can't help but thinking all this part of the API is a bit ... confusing.
Cas :)
Thank you for your speedy assistance! :)