private final GLUquadric gluNewQuadric(boolean useGLSL, ShaderState st, int shaderProgram) { GL gl = getCurrentGL(); if(useGLSL && !gl.isGL2ES2()) { throw new GLException("GLUquadric GLSL implementation not supported for profile: "+gl); } validateGLUquadricImpl(); return new GLUquadricImpl(gl, useGLSL, st, shaderProgram); }
protected GL2 getGL2(GLAutoDrawable drawable) { LOGGER.info("GL context : " + drawable.getContext()); LOGGER.info("GL profile : " + drawable.getGLProfile()); LOGGER.info("GL impl : " + drawable.getGL().getClass().getSimpleName()); LOGGER.info("isGL : " + drawable.getGL().isGL()); LOGGER.info("isGL2 : " + drawable.getGL().isGL2()); LOGGER.info("isGLES1 : " + drawable.getGL().isGL2ES1()); LOGGER.info("isGLES2 : " + drawable.getGL().isGL2ES2()); LOGGER.info("isGLES3 : " + drawable.getGL().isGL2ES3()); LOGGER.info("isGL2GL3 : " + drawable.getGL().isGL2GL3()); LOGGER.info("isGL3 : " + drawable.getGL().isGL3()); LOGGER.info("isGL3core : " + drawable.getGL().isGL3core()); LOGGER.info("isGL3ES3 : " + drawable.getGL().isGL3ES3()); LOGGER.info("isGL4 : " + drawable.getGL().isGL4()); LOGGER.info("isGL4bc : " + drawable.getGL().isGL4bc()); if (drawable.getGL() instanceof GL4bcImpl) { return drawable.getGL().getGL3().getGL2();//(GL2)drawable;//drawable.getGL().getGL2();//getGL3().getGL2(); } else { return (GL2)drawable;//drawable.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()); }