diff options
author | Sven Gothel <[email protected]> | 2012-08-17 13:47:48 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-08-17 13:47:48 +0200 |
commit | ee5c34e5bb067631572a7001ab1ec3543c52065f (patch) | |
tree | 6bd997c3da8e114b923faf66015fdbaac5791f24 /src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java | |
parent | 09a8151abe3934ccf17fa84d5b2000e259351312 (diff) |
Robostness: GLDrawableImpl's contextMadeCurrent()/contextRealized() ; GLFBODrawableImpl.contextMadeCurrent(false), OffscreenAutoDrawable.setSize(..)
GLDrawableImpl's contextMadeCurrent()/contextRealized():
- Catch exception which may appear during callback and cont. w/ GLContextImpl's release()/destroy()
while throwing catched exception at end.
GLFBODrawableImpl.contextMadeCurrent(false):
- Detect null Colorbuffer ASAP and throw exception
OffscreenAutoDrawable.setSize(..):
- Catch exceptions at 1) GLFBODrawableImpl.setSize(..) and
2) GLContext.release() .. throw it in proper order.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java b/src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java index 8450ffdb0..4caea03b2 100644 --- a/src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java +++ b/src/jogl/classes/com/jogamp/opengl/OffscreenAutoDrawable.java @@ -69,12 +69,26 @@ public class OffscreenAutoDrawable extends GLAutoDrawableDelegate { public boolean setSize(int newWidth, int newHeight) throws GLException { boolean done = false; if(drawable instanceof GLFBODrawableImpl) { + Throwable tFBO = null; + Throwable tGL = null; context.makeCurrent(); try { ((GLFBODrawableImpl)drawable).setSize(context.getGL(), newWidth, newHeight); done = true; + } catch (Throwable t) { + tFBO = t; } finally { - context.release(); + try { + context.release(); + } catch (Throwable t) { + tGL = t; + } + } + if(null != tFBO) { + throw new GLException("OffscreenAutoDrawable.setSize(..) GLFBODrawableImpl.setSize(..) exception", tFBO); + } + if(null != tGL) { + throw new GLException("OffscreenAutoDrawable.setSize(..) GLContext.release() exception", tGL); } } if(done) { |