diff options
author | Kenneth Russel <[email protected]> | 2005-10-24 19:21:03 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-10-24 19:21:03 +0000 |
commit | d6f9dbc493df725d3d574403549de142c5e1222a (patch) | |
tree | 8eb152b0627f8d1897a27c5204d6ce2efb4963e4 /src/native/jogl/MacOSXWindowSystemInterface.m | |
parent | 42843c3290d64c41c9c8a18b93f5ad3c00d35ddc (diff) |
Merged JSR-231 branch on to the main JOGL trunk. The main trunk now
contains the evolving JSR-231 Reference Implementation and the JSR-231
branch is permanently closed.
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@401 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/native/jogl/MacOSXWindowSystemInterface.m')
-rw-r--r-- | src/native/jogl/MacOSXWindowSystemInterface.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/native/jogl/MacOSXWindowSystemInterface.m b/src/native/jogl/MacOSXWindowSystemInterface.m index 516bda0db..125f6abb4 100644 --- a/src/native/jogl/MacOSXWindowSystemInterface.m +++ b/src/native/jogl/MacOSXWindowSystemInterface.m @@ -43,7 +43,19 @@ void* createContext(void* shareContext, void* view, NSView *nsView = (NSView*)view; if (nsView != NULL) { + Bool viewReady = true; + if ([nsView lockFocusIfCanDraw] == NO) { + viewReady = false; + } else { + NSRect frame = [nsView frame]; + if ((frame.size.width == 0) || (frame.size.height == 0)) { + [nsView unlockFocus]; + viewReady = false; + } + } + + if (!viewReady) { if (viewNotReady != NULL) { *viewNotReady = 1; } @@ -163,13 +175,17 @@ void* createPBuffer(int renderTarget, int internalFormat, int width, int height) } Bool destroyPBuffer(void* context, void* buffer) { - NSOpenGLContext *nsContext = (NSOpenGLContext*)context; + /* FIXME: not clear whether we need to perform the clearDrawable below */ + /* FIXME: remove the context argument -- don't need it any more */ + /* NSOpenGLContext *nsContext = (NSOpenGLContext*)context; */ NSOpenGLPixelBuffer *pBuffer = (NSOpenGLPixelBuffer*)buffer; NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; + /* if (nsContext != NULL) { [nsContext clearDrawable]; } + */ [pBuffer release]; [pool release]; |