99 NSOpenGLPixelFormatAttribute attrs[3];
100 int mac_version_major;
106 if(mac_version_major < 11) {
107 fprintf(stderr,
"[Mac OpenGL] Unable to activate OpenGL 3.2 for pre-Lion Macs.\n");
110 attrs[0] = kCGLPFAOpenGLProfile;
111 attrs[1] = kCGLOGLPVersion_3_2_Core;
114 fprintf(stderr,
"[Mac OpenGL] OpenGL 3.2 support was not compiled in! Did you compile with an older Mac?\n");
119 if(mac_version_major >= 11) {
120 attrs[0] = kCGLPFAOpenGLProfile;
121 attrs[1] = kCGLOGLPVersion_Legacy;
134 NSApp = [NSApplication sharedApplication];
138 if(mac_version_major >= 11) {
139 s->
pixFmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: attrs];
141 s->
pixFmt = [NSOpenGLView defaultPixelFormat];
145 fprintf(stderr,
"[Mac OpenGL] Failed to acquire pixel format.\n");
152 [ s->view initialize: s];
196 printf(
"OpenGL renderer: %s %s (GLSL: %s)\n", glGetString(GL_RENDERER), glGetString(GL_VERSION), glGetString(GL_SHADING_LANGUAGE_VERSION));