diff options
Diffstat (limited to 'macosx/plugins/PeopsXgl/macsrc/drawgl.m')
| -rw-r--r-- | macosx/plugins/PeopsXgl/macsrc/drawgl.m | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/macosx/plugins/PeopsXgl/macsrc/drawgl.m b/macosx/plugins/PeopsXgl/macsrc/drawgl.m index 91c7ecbf..dcc40ee2 100644 --- a/macosx/plugins/PeopsXgl/macsrc/drawgl.m +++ b/macosx/plugins/PeopsXgl/macsrc/drawgl.m @@ -149,10 +149,15 @@ unsigned long ulInitDisplay(void) // OPEN GAME WINDOW BuildDispMenu(0); } - PluginWindowController *windowController = [PluginWindowController openGameView]; - glView = [windowController getOpenGLView]; + __block PluginWindowController *windowController; + + // this causes a runtime error if it's done on a thread other than the main thread + dispatch_sync(dispatch_get_main_queue(), ^{ + windowController = [PluginWindowController openGameView]; + glView = [windowController getOpenGLView]; - [[windowController window] setTitle:[NSString stringWithCString:pCaptionText]]; + [[windowController window] setTitle:[NSString stringWithCString:pCaptionText encoding:NSUTF8StringEncoding]]; + }); return (unsigned long)[windowController window]; } @@ -182,7 +187,7 @@ void SendContextBack(void) void SetVSync(long myValue) { - long DoItMyFriend = myValue; + GLint DoItMyFriend = myValue; [[glView openGLContext] setValues: &DoItMyFriend forParameter: NSOpenGLCPSwapInterval]; } |
