Created
October 13, 2011 13:20
-
-
Save kovrov/1284195 to your computer and use it in GitHub Desktop.
Mac OS X Lion OpenGL Core Profile (CGLChoosePixelFormat)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* gcc -framework OpenGL main.c */ | |
#include <OpenGL/OpenGL.h> | |
#include <OpenGL/gl3.h> | |
#include <stdio.h> | |
int main(int argc, char **argv) | |
{ | |
CGLContextObj ctx; | |
CGLPixelFormatObj pix; | |
GLint npix; | |
CGLPixelFormatAttribute attribs[] = { | |
kCGLPFAOpenGLProfile, | |
kCGLOGLPVersion_3_2_Core, | |
0 | |
}; | |
CGLChoosePixelFormat(attribs, &pix, &npix); | |
CGLCreateContext(pix, NULL, &ctx); | |
CGLSetCurrentContext(ctx); | |
printf("%s %s\n", glGetString(GL_RENDERER), glGetString(GL_VERSION)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment