log CGLErrorString for CGLChoosePixelFormat, enable OpenGL

multithreading

https://developer.apple.com/library/mac/technotes/tn2085/_index.html
This commit is contained in:
Mike Morris
2014-09-30 17:42:27 -04:00
parent 848dccbcae
commit c4c4b3318a

View File

@@ -20,7 +20,7 @@ HeadlessView::HeadlessView() {
GLint num;
CGLError error = CGLChoosePixelFormat(attributes, &pixelFormat, &num);
if (error) {
fprintf(stderr, "Error pixel format\n");
fprintf(stderr, "Error pixel format: %s\n", CGLErrorString(error));
return;
}
@@ -30,6 +30,12 @@ HeadlessView::HeadlessView() {
fprintf(stderr, "Error creating GL context object\n");
return;
}
error = CGLEnable(gl_context, kCGLCEMPEngine);
if (error != kCGLNoError ) {
fprintf(stderr, "Error enabling OpenGL multithreading\n");
return;
}
#endif
#if MBGL_USE_GLX