public void end(GL2ES2 gl) { gl.glDisableVertexAttribArray(this.handles.inXy); gl.glDisableVertexAttribArray(this.handles.inFlags); gl.glDisableVertexAttribArray(this.handles.inMileage); gl.glDisableVertexAttribArray(this.handles.inRgba); gl.glUseProgram(0); gl.getGL3().glBindVertexArray(0); }
/** * Disables all vertex attribute arrays. * * <p>Their enabled stated will be removed from this state only if 'removeFromState' is true. * * <p>This method purpose is more for debugging. * * @see #glEnableVertexAttribArray * @see #glDisableVertexAttribArray * @see #glVertexAttribPointer * @see #getVertexAttribPointer * @see #glReleaseAllVertexAttributes * @see #glResetAllVertexAttributes * @see #glResetAllVertexAttributes * @see ShaderProgram#glReplaceShader */ public void disableAllVertexAttributeArrays(GL2ES2 gl, boolean removeFromState) { for (Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) { final String name = iter.next(); if (removeFromState) { activedAttribEnabledMap.remove(name); } final int index = getAttribLocation(gl, name); if (0 <= index) { gl.glDisableVertexAttribArray(index); } } }
private boolean disableVertexAttribArray(GL2ES2 gl, String name, int location) { activedAttribEnabledMap.put(name, Boolean.FALSE); if (0 > location) { location = getAttribLocation(gl, name); if (0 > location) { if (verbose) { System.err.println( "ShaderState: glDisableVertexAttribArray failed, no index for: " + name); if (DEBUG) { Thread.dumpStack(); } } return false; } } if (DEBUG) { System.err.println("ShaderState: glDisableVertexAttribArray: " + name); } gl.glDisableVertexAttribArray(location); return true; }