@Override public final GL setGL(final GL gl) { final GLContext _context = context; if (_context != null) { _context.setGL(gl); return gl; } return null; }
@Override public GL setGL(final GL gl) { final GLContext _context = context; if (_context != null) { _context.setGL(gl); return gl; } return null; }
@Override public GL setGL(final GL arg0) { final GLContext _context = context; if (null != _context) { _context.setGL(arg0); return arg0; } return null; }
@Override public GL setGL(final GL gl) { final GLContext context = getContext(); if (context != null) { context.setGL(gl); return gl; } return null; }
@Override public void init(final GLAutoDrawable drawable) { GL _gl = drawable.getGL(); if(glDebug) { try { _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) ); } catch (final Exception e) {e.printStackTrace();} } if(glTrace) { try { // Trace .. _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) ); } catch (final Exception e) {e.printStackTrace();} } if(glSwapInterval>=0) { _gl.setSwapInterval(glSwapInterval); } } @Override
if (_context.getGL().isGLES()) { if (_context.getGL().isGLES1()) { _context.setGL(new DebugGLES1(_context.getGL().getGLES1())); } else { if (_context.getGL().isGLES2()) { _context.setGL(new DebugGLES2(_context.getGL().getGLES2())); } else { _context.setGL(new DebugGL4bc(_context.getGL().getGL4bc())); } else { if (_context.getGL().isGL4()) { _context.setGL(new DebugGL4(_context.getGL().getGL4())); } else { if (_context.getGL().isGL3bc()) { _context.setGL(new DebugGL3bc(_context.getGL().getGL3bc())); } else { if (_context.getGL().isGL3()) { _context.setGL(new DebugGL3(_context.getGL().getGL3())); } else { if (_context.getGL().isGL2()) { _context.setGL(new DebugGL2(_context.getGL().getGL2()));
/** * @param gl * @param mode one of the {@link ShaderSelectionMode}s * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline} * @return If gl is a GL2ES1 and force is false, return the type cast object, * otherwise create a fixed function emulation pipeline using the given GL2ES2 impl * and hook it to the GLContext via {@link GLContext#setGL(GL)}. * @throws GLException if the GL object is neither GL2ES1 nor GL2ES2 * * @see ShaderSelectionMode#AUTO * @see ShaderSelectionMode#COLOR * @see ShaderSelectionMode#COLOR_LIGHT_PER_VERTEX * @see ShaderSelectionMode#COLOR_TEXTURE * @see ShaderSelectionMode#COLOR_TEXTURE_LIGHT_PER_VERTEX */ public static final GL2ES1 wrapFixedFuncEmul(final GL gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix, final boolean force, final boolean verbose) { if(gl.isGL2ES2() && ( !gl.isGL2ES1() || force ) ) { final GL2ES2 es2 = gl.getGL2ES2(); final FixedFuncHook hook = new FixedFuncHook(es2, mode, pmvMatrix); hook.setVerbose(verbose); final FixedFuncImpl impl = new FixedFuncImpl(es2, hook); gl.getContext().setGL(impl); return impl; } else if(gl.isGL2ES1()) { return gl.getGL2ES1(); } throw new GLException("GL Object is neither GL2ES1 nor GL2ES2: "+gl.getContext()); }