diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java index 8d65f16d3..b51f290e9 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java @@ -275,7 +275,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { final GLCapabilitiesChooser chooser, final int width, final int height) { final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height ); - drawable.setRealized(true); + try { + drawable.setRealized(true); + } catch( final GLException gle) { + try { + drawable.setRealized(false); + } catch( final GLException gle2) { /* ignore */ } + throw gle; + } if(drawable instanceof GLFBODrawableImpl) { return new GLOffscreenAutoDrawableImpl.FBOImpl( (GLFBODrawableImpl)drawable, null, null, null ); } @@ -285,7 +292,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory { @Override public final GLAutoDrawable createDummyAutoDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) { final GLDrawable drawable = createDummyDrawable(deviceReq, createNewDevice, capsRequested, chooser); - drawable.setRealized(true); + try { + drawable.setRealized(true); + } catch( final GLException gle) { + try { + drawable.setRealized(false); + } catch( final GLException gle2) { /* ignore */ } + throw gle; + } final GLAutoDrawable sharedDrawable = new GLAutoDrawableDelegate(drawable, null, null, true /*ownDevice*/, null) { }; return sharedDrawable; } |