public void glClientActiveTexture(int textureUnit) { textureUnit -= GL.GL_TEXTURE0; if(0 <= textureUnit && textureUnit<MAX_TEXTURE_UNITS) { clientActiveTextureUnit = textureUnit; } else { throw new GLException("glClientActiveTexture textureUnit not within GL_TEXTURE0 + [0.."+MAX_TEXTURE_UNITS+"]: "+textureUnit); } }
public void releaseCurrentContext() { if (_context.equals(GLContext.getCurrent())) { try { _context.release(); } catch (final GLException gle) { gle.printStackTrace(); } } }
if(null==context) { if (DEBUG) { GLException.dumpThrowable("informal", new GLException("Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext"));
} catch (final GLException gle) { System.err.println("Caught exception on thread "+Thread.currentThread().getName()); gle.printStackTrace(); info.shaderCompilerAvailable = new Boolean(true); } else { throw new GLException("Invalid OpenGL profile");
if(!resetQuirkInfoDumped) { resetQuirkInfoDumped = true; System.err.println("GLFBODrawable: FBO Reset failed: "+e.getMessage()); System.err.println("GLFBODrawable: Enabling FBOResetQuirk, due to GL driver bug."); final JoglVersion joglVersion = JoglVersion.getInstance(); System.err.println(joglVersion.toString()); System.err.println(JoglVersion.getGLInfo(gl, null)); e.printStackTrace();
public void checkCardError() throws Ardor3dException { final GL gl = GLContext.getCurrentGL(); final GLU glu = new GLU(); try { final int errorCode = gl.glGetError(); if (errorCode != GL.GL_NO_ERROR) { throw new GLException(glu.gluErrorString(errorCode)); } } catch (final GLException exception) { throw new Ardor3dException("Error in opengl: " + exception.getMessage(), exception); } }
if (GLContext.CONTEXT_NOT_CURRENT != res) { if(GLContext.CONTEXT_CURRENT_NEW == res) { throw new GLException(GLDrawableHelper.getThreadName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context was not created (new ctx): "+context); GLException.dumpThrowable("subsequent", contextCloseCaught); throw GLException.newGLException(contextCloseCaught);
exclusiveContextSwitch = 1; // claim if( null != exclusiveContextThread ) { throw new GLException("Release current exclusive Context Thread "+exclusiveContextThread+" first"); } catch (final Throwable ex) { flushGLRunnables(); throw GLException.newGLException(ex);
firstCaught = t; } else { GLException.dumpThrowable("subsequent", t); firstCaught = t; } else { GLException.dumpThrowable("subsequent", t); throw GLException.newGLException(firstCaught);
throw GLException.newGLException(exceptionOnUnrealize);
private static synchronized Texture loadTextureFromFile( String textureID ) { Texture result = null; String fileName = idToFile.get( textureID ); if ( fileName != null && !"".equals( fileName.trim() ) ) { File f = new File( fileName ); try { result = TextureIO.newTexture( f, true ); } catch ( GLException e ) { LOG.error( "Error while trying to load texture with fileName:" + fileName + " cause: " + e.getLocalizedMessage(), e ); } catch ( IOException e ) { LOG.error( "Error while trying to load texture with fileName:" + fileName + " cause: " + e.getLocalizedMessage(), e ); } if ( result != null ) { idToTexture.put( textureID, result ); } } return result; }
/** * Default implementation to handle destroy notifications from the windowing system. * * <p> * If the {@link NativeSurface} does not implement {@link WindowClosingProtocol} * or {@link WindowClosingMode#DISPOSE_ON_CLOSE} is enabled (default), * a thread safe destruction is being induced. * </p> */ protected final void defaultWindowDestroyNotifyOp() { final NativeSurface ns = getNativeSurface(); final boolean shallClose; if(ns instanceof WindowClosingProtocol) { shallClose = WindowClosingMode.DISPOSE_ON_CLOSE == ((WindowClosingProtocol)ns).getDefaultCloseOperation(); } else { shallClose = true; } if( shallClose ) { try { destroyAvoidAwareOfLocking(); } catch( final Throwable t ) { // Intentionally catch and ignore exception, // so the destroy mechanism of the native windowing system is not corrupted! GLException.dumpThrowable("ignored", t); } } }
throw new GLException("FBO not supported w/ context: "+gl.getContext()+", "+this); gl.glGetIntegerv(GL2ES2.GL_MAX_COLOR_ATTACHMENTS, val, 0); realMaxColorAttachments = 1 <= val[0] ? val[0] : 1; // cap minimum to 1 } catch (final GLException gle) { gle.printStackTrace(); } throw new GLException("Size "+width+"x"+height+" exceeds on of the maxima renderbuffer size "+maxRenderbufferSize+": \n\t"+this); fbName = val[0]; if(0 == fbName) { throw new GLException("null framebuffer");
} catch (final GLException gle) { if( DEBUG ) { System.err.println("Caught: "+gle.getMessage()); gle.printStackTrace();
throw new GLException("Caught GLException: "+glException.getMessage(), glException);
flushGLRunnables(); if( null != contextReleaseCaught ) { GLException.dumpThrowable("subsequent", contextReleaseCaught); throw GLException.newGLException(glEventListenerCaught); throw GLException.newGLException(contextReleaseCaught);
throw GLException.newGLException(exceptionOnUnrealize); throw GLException.newGLException(exceptionOnDeviceClose);
@Override public javax.media.opengl.GL2ES2 getGL2ES2() { throw new GLException("Not a GL2ES2 implementation"); } @Override
throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice); throw new GLException("Couldn't create shared context for drawable: "+sharedDrawable); if (DEBUG) { System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: makeCurrent caught exception:"); gle.printStackTrace(); if (DEBUG) { System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: destroy caught exception:"); gle.printStackTrace();
} catch (final GLException gle) { if( DEBUG ) { System.err.println("Caught: "+gle.getMessage()); gle.printStackTrace();