From 8ef7760168c7051163c2a265c8662f1647a116c6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 10 Aug 2013 08:43:08 +0200 Subject: GLFBODrawableImpl.initialize(): Unrealize when already unrealized shall not throw an exception - only dump DEBUG info! --- src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java index 3833e6852..d7979efdb 100644 --- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java @@ -102,8 +102,15 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable { } private final void initialize(boolean realize, GL gl) { + if( !initialized && !realize ) { + if( DEBUG ) { + System.err.println("GLFBODrawableImpl.initialize(): WARNING - Already unrealized!"); + Thread.dumpStack(); + } + return; // NOP, no exception for de-init twice or no init! + } if( initialized == realize ) { - throw new InternalError("Already set to initialize := "+realize+": "+this); + throw new IllegalStateException("initialize already in state "+realize+": "+this); } if(realize) { final GLCapabilities chosenFBOCaps = (GLCapabilities) getChosenGLCapabilities(); // cloned at setRealized(true) -- cgit v1.2.3