From 89b09958ef1ad9cdc228517d2acaa0dc27aa559f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 29 Jun 2012 03:59:22 +0200 Subject: Minor cleanup --- src/jogl/classes/jogamp/opengl/GLDrawableHelper.java | 8 ++++---- .../jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) (limited to 'src/jogl/classes/jogamp') diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java index c992b3cb2..e7651eaab 100644 --- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java +++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java @@ -413,10 +413,10 @@ public class GLDrawableHelper { try { res = context.makeCurrent(); - if (res != GLContext.CONTEXT_NOT_CURRENT) { + if (GLContext.CONTEXT_NOT_CURRENT != res) { if(!isDisposeAction) { perThreadInitAction.set(initAction); - if (res == GLContext.CONTEXT_CURRENT_NEW) { + if (GLContext.CONTEXT_CURRENT_NEW == res) { if (DEBUG) { System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running initAction"); } @@ -427,7 +427,7 @@ public class GLDrawableHelper { drawable.swapBuffers(); } } else { - if(res == GLContext.CONTEXT_CURRENT_NEW) { + if(GLContext.CONTEXT_CURRENT_NEW == res) { throw new GLException(currentThread.getName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context was not created (new ctx): "+context); } if(listeners.size()>0) { @@ -439,7 +439,7 @@ public class GLDrawableHelper { try { if(isDisposeAction) { context.destroy(); - } else if( res != GLContext.CONTEXT_NOT_CURRENT ) { + } else if( GLContext.CONTEXT_NOT_CURRENT != res ) { context.release(); } } catch (Exception e) { diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java index 734716677..9e22afa6d 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java @@ -57,22 +57,24 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable { useGLXWindow=false; } - @SuppressWarnings("unused") @Override public long getHandle() { - if(USE_GLXWINDOW && useGLXWindow) { - return glXWindow; + if(USE_GLXWINDOW) { + if(useGLXWindow) { + return glXWindow; + } } return super.getHandle(); } - @SuppressWarnings("unused") @Override protected void destroyHandle() { - if(USE_GLXWINDOW && 0!=glXWindow) { - GLX.glXDestroyWindow(getNativeSurface().getDisplayHandle(), glXWindow); - glXWindow = 0; - useGLXWindow=false; + if(USE_GLXWINDOW) { + if(0!=glXWindow) { + GLX.glXDestroyWindow(getNativeSurface().getDisplayHandle(), glXWindow); + glXWindow = 0; + useGLXWindow=false; + } } } -- cgit v1.2.3