/** * @param program * @param name * @return * @see com.jogamp.opengl.GL2ES2#glGetUniformLocation(int, java.lang.String) */ public int glGetUniformLocation(int program, String name) { try{ return delegate.glGetUniformLocation(program, name);} catch(GLException e){glException(e); throw e;} } /**
@Override public int getUniformLocation(int glProgram, String uniformName) { gl.glUseProgram(glProgram); return gl.glGetUniformLocation(glProgram, uniformName); }
/** * Returns the location of the specified uniform. * @param uniformName name of the uniform * @return GL handle to the specified attribute */ int getUniformLocation(final String uniformName) { if (uniformName == null || uniformName.isEmpty()) throw new RuntimeException("uniformName was empty or null"); int uniform = gl.glGetUniformLocation(getGLHandle(), uniformName); if (uniform == -1) throw new RuntimeException("Program getUniformLocation not found: " + uniformName); return uniform; }
public GLUniform getUniform(String uniformName) { final int loc = gl.glGetUniformLocation(programID, uniformName); if (loc == -1) throw new RuntimeException("Could not find uniform " + uniformName); else if (loc < 0) throw new RuntimeException("Invalid uniform location on lookup: " + loc + " of name " + uniformName); return new GLUniform(this, loc); }//end getUniform()
public GLUniform getUniform(String pUniformName) { if (uniforms.containsKey(pUniformName) && !isStale()) { return uniforms.get(pUniformName); } else { final int lUniformId = mGL.getGL3().glGetUniformLocation(mProgramId, pUniformName); final GLUniform lGLUniform = new GLUniform(this, lUniformId); uniforms.put(pUniformName, lGLUniform); return lGLUniform; } }
@Override public int glGetUniformLocation(int program, String name) { return GLContext.getCurrentGL().getGL3().glGetUniformLocation(program, name); }
final int uid = g.glGetUniformLocation(this.program, "m_projection"); assert uid != -1; g.glUniformMatrix4fv( final int uid = g.glGetUniformLocation(this.program, "m_modelview"); assert uid != -1;
final int uid = g.glGetUniformLocation(this.program_uv, "m_projection"); assert uid != -1; g.glUniformMatrix4fv( final int uid = g.glGetUniformLocation(this.program_uv, "f_texture"); assert uid != -1; final int uid = g.glGetUniformLocation(this.program_uv, "m_modelview"); assert uid != -1;
final int uid = g.glGetUniformLocation(this.program, "m_projection"); assert uid != -1; g.glUniformMatrix4fv( final int uid = g.glGetUniformLocation(this.program, "m_modelview"); assert uid != -1;