X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fglws_cocoa.mm;h=df7dd84018171b298532021200595903b31d40a5;hb=808f1ccdb87a7962ae3f7c149c0e031b24f150c3;hp=8ec58b13903c8b9762eda4278e8a627e193260fc;hpb=cfd878f0acabbb34a428b151d63b73769464fabc;p=apitrace diff --git a/retrace/glws_cocoa.mm b/retrace/glws_cocoa.mm index 8ec58b1..df7dd84 100644 --- a/retrace/glws_cocoa.mm +++ b/retrace/glws_cocoa.mm @@ -74,6 +74,7 @@ class CocoaDrawable : public Drawable { public: NSWindow *window; + NSOpenGLView *view; NSOpenGLContext *currentContext; CocoaDrawable(const Visual *vis, int w, int h, bool pbuffer) : @@ -93,9 +94,9 @@ public: defer:NO]; assert(window != nil); - NSOpenGLView *view = [[NSOpenGLView alloc] - initWithFrame:winRect - pixelFormat:pixelFormat]; + view = [[NSOpenGLView alloc] + initWithFrame:winRect + pixelFormat:pixelFormat]; assert(view != nil); [window setContentView:view]; @@ -118,7 +119,7 @@ public: if (currentContext != nil) { [currentContext update]; [window makeKeyAndOrderFront:nil]; - [currentContext setView:[window contentView]]; + [currentContext setView:view]; [currentContext makeCurrentContext]; }