From 474ada7c9fa2c9e47232abfde66353af58ea35f2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 23 Jan 2015 20:36:13 +0100 Subject: Misc Fix: GLContext*; Refine DEBUG output in GLDrawableFactory's createShareResource - Fix GLContext.makeCurrent() API doc for 'throws GLException' - Fix GLContext.makeCurrentResultToString(int): CONTEXT_CURRENT_NEW -> "CONTEXT_CURRENT_NEW" - Fix GLContextImpl.setGLDrawable(..) - Catch Throwable instead of GLException to not loose other cases - Fix GLContextImpl.makeCurrent(..) - Use const l-value in branch expression - fix semantic typo: validate -> validated - Refine DEBUG output in GLDrawableFactory's createShareResource - Enable DEBUG via GLContext.DEBUG as well to ease analysis w/o drawable DEBUG output --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/GLContextImpl.java') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index e2a35efb1..bc0603268 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -277,11 +277,11 @@ public abstract class GLContextImpl extends GLContext { drawable = (GLDrawableImpl) readWrite ; if( isCreated() && null != drawable && drawable.isRealized() ) { int res = CONTEXT_NOT_CURRENT; - GLException gle = null; + Throwable gle = null; try { res = makeCurrent(true); // implicit: associateDrawable(true) - } catch ( final GLException e ) { - gle = e; + } catch ( final Throwable t ) { + gle = t; } finally { if( CONTEXT_NOT_CURRENT == res ) { // Failure, recover and bail out w/ GLException @@ -663,19 +663,19 @@ public abstract class GLContextImpl extends GLContext { } } - if (res != CONTEXT_NOT_CURRENT) { // still locked! + if ( CONTEXT_NOT_CURRENT != res ) { // still locked! if( 0 == drawable.getHandle() && !surfacelessOK ) { if( hasRendererQuirk(GLRendererQuirks.NoSurfacelessCtx) ) { throw new GLException(String.format("Surfaceless not supported due to quirk %s: %s", GLRendererQuirks.toString(GLRendererQuirks.NoSurfacelessCtx), toString())); } if( DEBUG ) { - System.err.println(getThreadName() +": GLContext.makeCurrent: Surfaceless OK - validate"); + System.err.println(getThreadName() +": GLContext.makeCurrent: Surfaceless OK - validated"); } surfacelessOK = true; } setCurrent(this); - if(res == CONTEXT_CURRENT_NEW) { + if( CONTEXT_CURRENT_NEW == res ) { // check if the drawable's and the GL's GLProfile are equal // throws an GLException if not drawable.getGLProfile().verifyEquality(gl.getGLProfile()); -- cgit v1.2.3