/** * Deletes the program, and resets this object to the way it was before {@link #handles(GL2ES2)} * was first called. * <p> * This object can be safely reused after being disposed, but in most cases there is no * significant advantage to doing so. */ public void dispose( GL2ES2 gl ) { if ( this.handles != null ) { gl.glDeleteProgram( this.handles.program ); this.handles = null; } }
/** * Deletes the program, and resets this object to the way it was before {@link #begin(GL2ES2)} * was first called. * <p> * This object can be safely reused after being disposed, but in most cases there is no * significant advantage to doing so. */ public void dispose( GL2ES2 gl ) { if ( this.handles != null ) { gl.glDeleteProgram( this.handles.program ); this.handles = null; } }
/** * Deletes the program, and resets this object to the way it was before {@link #handles(GL2ES2)} * was first called. * <p> * This object can be safely reused after being disposed, but in most cases there is no * significant advantage to doing so. */ public void dispose( GL2ES2 gl ) { if ( this.handles != null ) { gl.glDeleteProgram( this.handles.program ); this.handles = null; } }
/** * Deletes the program, and resets this object to the way it was before {@link #handles(GL2ES2)} * was first called. * <p> * This object can be safely reused after being disposed, but in most cases there is no * significant advantage to doing so. */ public void dispose( GL2ES2 gl ) { if ( this.handles != null ) { gl.glDeleteProgram( this.handles.program ); this.handles = null; } }
/** * Deletes the program, and resets this object to the way it was before {@link #handles(GL2ES2)} * was first called. * <p> * This object can be safely reused after being disposed, but in most cases there is no * significant advantage to doing so. */ public void dispose( GL2ES2 gl ) { if ( this.handles != null ) { gl.glDeleteProgram( this.handles.program ); this.handles = null; } }
/** * Detaches all shader codes and deletes the program. * If <code>destroyShaderCode</code> is true it destroys the shader codes as well. */ public synchronized void release(final GL2ES2 gl, final boolean destroyShaderCode) { if( programLinked ) { useProgram(gl, false); } for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) { final ShaderCode shaderCode = iter.next(); if(attachedShaderCode.remove(shaderCode)) { ShaderUtil.detachShader(gl, shaderProgram, shaderCode.shader()); } if(destroyShaderCode) { shaderCode.destroy(gl); } } allShaderCode.clear(); attachedShaderCode.clear(); if( 0 != shaderProgram ) { gl.glDeleteProgram(shaderProgram); shaderProgram=0; } }