diff options
-rw-r--r-- | make/stub_includes/opengl/macosx-window-system.h | 1 | ||||
-rw-r--r-- | src/jogl/native/macosx/MacOSXWindowSystemInterface.m | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h index 402a16efc..2bfe86aa4 100644 --- a/make/stub_includes/opengl/macosx-window-system.h +++ b/make/stub_includes/opengl/macosx-window-system.h @@ -37,6 +37,7 @@ NSOpenGLContext* createContext(NSOpenGLContext* shareContext, Bool opaque, int* viewNotReady); void setContextView(NSOpenGLContext* ctx, NSView* view); +void clearDrawable(NSOpenGLContext* ctx); Bool makeCurrentContext(NSOpenGLContext* ctx); Bool clearCurrentContext(NSOpenGLContext *ctx); Bool deleteContext(NSOpenGLContext* ctx, Bool releaseOnMainThread); diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m index 38f1789e3..d4d3ddad9 100644 --- a/src/jogl/native/macosx/MacOSXWindowSystemInterface.m +++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface.m @@ -577,15 +577,22 @@ void setContextView(NSOpenGLContext* ctx, NSView* view) { [ctx setView:view]; [view unlockFocus]; } - } else { - DBG_PRINT("setContextView.1: ctx %p, view nil: clearDrawable\n", ctx); - [ctx clearDrawable]; } DBG_PRINT("setContextView.X\n"); } [pool release]; } +void clearDrawable(NSOpenGLContext* ctx) { + NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + if ( nil != ctx ) { + DBG_PRINT("clearDrawable.0: %p\n", ctx); + [ctx clearDrawable]; + DBG_PRINT("clearDrawable.X\n"); + } + [pool release]; +} + Bool makeCurrentContext(NSOpenGLContext* ctx) { #if 0 // we issue the CGL Lock from Java upfront! |