log CGLErrorString for CGLChoosePixelFormat, enable OpenGL
multithreading https://developer.apple.com/library/mac/technotes/tn2085/_index.html
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user