/** * @param program * @param name * @return * @see com.jogamp.opengl.GL2ES2#glGetAttribLocation(int, java.lang.String) */ public int glGetAttribLocation(int program, String name) { try{ return delegate.glGetAttribLocation(program, name);} catch(GLException e){glException(e); throw e;} } /**
@Override public int getAttributeLocation(int glProgram, String attributeName) { gl.glUseProgram(glProgram); return gl.glGetAttribLocation(glProgram, attributeName); }
/** * Returns the location of the specified attribute. * @param attribName name of the attribute * @return GL handle to the specified attribute */ public int getAttributeLocation(final String attribName) { if (attribName == null || attribName.isEmpty()) throw new RuntimeException("attribName was empty or null"); int attrib = gl.glGetAttribLocation(getGLHandle(), attribName); if (attrib == -1) { throw new RuntimeException("Program attribute not found: " + attribName); } // System.out.println("Attrib '" + attribName + "' is " + attrib); return attrib; }
public GLAttribute getAttribute(final String pAttributeName) { final int lAttributeId = mGL.getGL3() .glGetAttribLocation(mProgramId, pAttributeName); final GLAttribute lGLAttribute = new GLAttribute(this, lAttributeId); return lGLAttribute; }
@Override public int glGetAttribLocation(int program, String name) { return GLContext.getCurrentGL().getGL3().glGetAttribLocation(program, name); }
position_attrib = g.glGetAttribLocation(this.program, "v_position"); assert position_attrib != -1; color_attrib = g.glGetAttribLocation(this.program, "v_color"); assert color_attrib != -1;
position_attrib = g.glGetAttribLocation(this.program, "v_position"); assert position_attrib != -1; color_attrib = g.glGetAttribLocation(this.program, "v_color"); assert color_attrib != -1;
position_attrib = g.glGetAttribLocation(this.program_uv, "v_position"); assert position_attrib != -1; uv_attrib = g.glGetAttribLocation(this.program_uv, "v_uv"); assert uv_attrib != -1;