@Override public void release(DrawContext dc) { this.deleteProgram(dc); }
public boolean useProgram(DrawContext dc) { if (this.mustBuildProgram) { // Clear the program's build dirty bit. this.mustBuildProgram = false; // Remove any existing GLSL program. if (this.programId != 0) { this.deleteProgram(dc); } // Compile and link the GLSL program sources. if (this.programSources != null) { this.buildProgram(dc, this.programSources, this.attribBindings); } // Give subclasses an opportunity to initialize default GLSL uniform values. if (this.programId != 0) { int currentProgram = dc.currentProgram(); try { dc.useProgram(this.programId); this.initProgram(dc); } finally { dc.useProgram(currentProgram); } } } if (this.programId != 0) { dc.useProgram(this.programId); } return this.programId != 0; }
public ShaderProgram putShaderProgram(Object key, ShaderProgram program) { this.renderResourceCache.put(key, program, (program != null) ? program.getProgramLength() : 0); return program; }