Create NSOpenGLContext synchronously

This is consistent with all other code that runs on the main UI thread, and
slightly easier to reason about.
master
Graham 5 years ago
parent 2c20668aac
commit c5b8487e1b
  1. 2
      gl-natives/src/main/c/jaggl.c

@ -551,7 +551,7 @@ JNIEXPORT jboolean JNICALL Java_jaggl_context_createContext(JNIEnv *env, jclass
CGLCreateContext(jaggl_pix, jaggl_onscreen_context, &jaggl_context); CGLCreateContext(jaggl_pix, jaggl_onscreen_context, &jaggl_context);
if (jaggl_context) { if (jaggl_context) {
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_sync(dispatch_get_main_queue(), ^{
jaggl_context_appkit = [[NSOpenGLContext alloc] initWithCGLContextObj:jaggl_context]; jaggl_context_appkit = [[NSOpenGLContext alloc] initWithCGLContextObj:jaggl_context];
jaggl_context_appkit.view = jaggl_view; jaggl_context_appkit.view = jaggl_view;
}); });

Loading…
Cancel
Save