OpenGL 3.2 on MacBook Air
I have a MacBook Air with the NVIDIA GeForce 320M. I just got Lion installed and wanted to start playing with OpenGL 3.2. I watched one of the WWDC videos and they explained how to get a 3.2 context, however no matter what I try I always end up with a 2.1 version coming back from glGetString. Any ideas?
Here's the code I'm trying to use:
Here's the code I'm trying to use:
Code:
NSOpenGLPixelFormatAttribute attr[] =
{
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
NSOpenGLPFAColorSize, 24,
NSOpenGLPFAAlphaSize, 8,
NSOpenGLPFAAccelerated, 0
};
NSOpenGLPixelFormat *pix = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr];
[self.glView setPixelFormat:pix];
NSString *versionString = [NSString stringWithCString:(const char*)glGetString(GL_VERSION)
encoding:NSASCIIStringEncoding];
NSLog(@"OpenGL Version: %@", versionString);
I don't know that setting the pixel format on an OpenGL view recreates the context, and it certainly doesn't make the context current...
You might like to start with eg. https://github.com/onesadcookie/ObjCGameBase and modify the pixel format attributes there.
You might like to start with eg. https://github.com/onesadcookie/ObjCGameBase and modify the pixel format attributes there.
Thanks, I'll give that a try when I get home from work tonight.
You were right on the contexts. I changed to creating my own context and setting it on the view, plus calling the makeCurrentContext method and now I'm getting a nice 3.2 version back from OpenGL. Excellent. Thanks.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| GLSL fragment program limits on GMA950 (MacBook) | memon | 12 | 7,949 |
Oct 26, 2007 05:18 PM Last Post: arekkusu |
|

