summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-12-17 21:54:36 +0100
committerSven Gothel <[email protected]>2011-12-17 21:54:36 +0100
commitb5492631bbcfe23f9a6a292bfc5f53c7a7b8caec (patch)
tree6dd2ec1b5e0fc285d24443ba05927d5d42379a3a /src/jogl/classes
parent8e0f3ad54b5aa8ef4d71e0b85f84a34be4987b5e (diff)
MacOSXCGLContext Offscreen Layer: Throw exception in case drawable is not realized or texture size is invalid.
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 166876b24..77da2650f 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -477,9 +477,12 @@ public abstract class MacOSXCGLContext extends GLContextImpl
texHeight = drawable.getHeight();
}
nsOpenGLLayer = CGL.createNSOpenGLLayer(ctx, nsOpenGLLayerPFmt, drawable.getHandle(), fixedCaps.isBackgroundOpaque(), texWidth, texHeight);
+ if(0>=texWidth || 0>=texHeight || !drawable.isRealized()) {
+ throw new GLException("Drawable not realized yet or invalid texture size, texSize "+texWidth+"x"+texHeight+", "+drawable);
+ }
if (DEBUG) {
- System.err.println("NS create nsOpenGLLayer "+toHexString(nsOpenGLLayer));
- }
+ System.err.println("NS create nsOpenGLLayer "+toHexString(nsOpenGLLayer)+", texSize "+texWidth+"x"+texHeight+", "+drawable);
+ }
backingLayerHost.attachSurfaceLayer(nsOpenGLLayer);
}
} finally {