/** * Disables all vertex attribute arrays. * * Their enabled stated will be removed from this state only * if 'removeFromState' is true. * * 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(final GL2ES2 gl, final boolean removeFromState) { for(final 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); } } }
public void disable() { GL2ES2 gl = gc.getGL().getGL2ES2(); for (AttributConfig ac : configs) { gl.glDisableVertexAttribArray(ac.index); } } }
private boolean disableVertexAttribArray(final GL2ES2 gl, final 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; }
private static void clearEnabledAttributes(final ShaderObjectsStateRecord record, final GL gl) { // go through and disable any enabled attributes if (!record.enabledAttributes.isEmpty()) { for (int i = 0, maxI = record.enabledAttributes.size(); i < maxI; i++) { final ShaderVariable var = record.enabledAttributes.get(i); if (var.getSize() == 1) { if (gl.isGL2()) { gl.getGL2().glDisableVertexAttribArrayARB(var.variableID); } else { if (gl.isGL2ES2()) { gl.getGL2ES2().glDisableVertexAttribArray(var.variableID); } } } else { for (int j = 0, maxJ = var.getSize(); j < maxJ; j++) { if (gl.isGL2()) { gl.getGL2().glDisableVertexAttribArrayARB(var.variableID + j); } else { if (gl.isGL2ES2()) { gl.getGL2ES2().glDisableVertexAttribArray(var.variableID + j); } } } } } record.enabledAttributes.clear(); } } }
@Override public final void enableState(final GL gl, final boolean enable, final Object ext) { final GL2ES2 glsl = gl.getGL2ES2(); if( null != ext ) { final ShaderState st = (ShaderState)ext; if(enable) { st.enableVertexAttribArray(glsl, ad); } else { st.disableVertexAttribArray(glsl, ad); } } else { final int location = ad.getLocation(); if( 0 <= location ) { if(enable) { glsl.glEnableVertexAttribArray(location); } else { glsl.glDisableVertexAttribArray(location); } } } } }
glsl.glVertexAttribPointer(vArrayData); } else { glsl.glDisableVertexAttribArray(vArrayData.getLocation()); glsl.glVertexAttribPointer(cArrayData); } else { glsl.glDisableVertexAttribArray(cArrayData.getLocation()); glsl.glVertexAttribPointer(nArrayData); } else { glsl.glDisableVertexAttribArray(nArrayData.getLocation()); glsl.glVertexAttribPointer(tArrayData); } else { glsl.glDisableVertexAttribArray(tArrayData.getLocation());
gl.glDisableVertexAttribArray( handles.inAreaVertex ); gl.glDisableVertexAttribArray( handles.inLineVertex ); gl.glDisableVertexAttribArray( handles.inIconVertex ); gl.glDisableVertexAttribArray( handles.inLabelVertex ); gl.glDisableVertexAttribArray( handles.inImageAlign ); gl.glDisableVertexAttribArray( handles.inImageBounds );