diff options
author | Sven Gothel <[email protected]> | 2013-08-25 05:13:08 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-08-25 05:13:08 +0200 |
commit | 78b4d4ac014af4cc43638ecdb69daf1e17a9b7d1 (patch) | |
tree | e5cac245b4bf8e5180d465e110709522595b0606 /src | |
parent | 8130f54fa3d7cdde59f4a88af081c44ddfb2c7f0 (diff) |
GLAutoDrawableBase: DEBUG code - Avoid NPE
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java index bfa748a54..f8b453555 100644 --- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java +++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java @@ -118,7 +118,8 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe final boolean res = isGLStatePreservationSupported() ? true : false; if( res ) { if( DEBUG ) { - System.err.println("GLAutoDrawableBase.setPreserveGLStateAtDestroy: ("+getThreadName()+"): "+preserveGLELSAtDestroy+" -> "+value+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle())); + final long surfaceHandle = null != getNativeSurface() ? getNativeSurface().getSurfaceHandle() : 0; + System.err.println("GLAutoDrawableBase.setPreserveGLStateAtDestroy: ("+getThreadName()+"): "+preserveGLELSAtDestroy+" -> "+value+" - surfaceHandle 0x"+Long.toHexString(surfaceHandle)); } preserveGLELSAtDestroy = value; } @@ -200,7 +201,8 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe GLDrawableImpl _drawable = drawable; if( null!=_drawable ) { if(DEBUG) { - System.err.println("GLAutoDrawableBase.sizeChanged: ("+getThreadName()+"): "+newWidth+"x"+newHeight+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle())); + final long surfaceHandle = null != getNativeSurface() ? getNativeSurface().getSurfaceHandle() : 0; + System.err.println("GLAutoDrawableBase.sizeChanged: ("+getThreadName()+"): "+newWidth+"x"+newHeight+" - surfaceHandle 0x"+Long.toHexString(surfaceHandle)); } if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) { final RecursiveLock _lock = getLock(); |