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 d7be5f667e
commit a2edbb8781
  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