summaryrefslogtreecommitdiffstats
path: root/src/native/jogl/MacOSXWindowSystemInterface.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/native/jogl/MacOSXWindowSystemInterface.m')
-rw-r--r--src/native/jogl/MacOSXWindowSystemInterface.m18
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];