Example usage for com.badlogic.gdx.graphics GL20 glDeleteShader

List of usage examples for com.badlogic.gdx.graphics GL20 glDeleteShader

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL20 glDeleteShader.

Prototype

public void glDeleteShader(int shader);

Source Link

Usage

From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java

License:Apache License

/** Disposes all resources associated with this shader. Must be called when the shader is no longer used. */
public void dispose() {
    GL20 gl = Gdx.gl20;
    gl.glUseProgram(0);/*from ww w.  jav  a 2 s .  com*/
    gl.glDeleteShader(vertexShaderHandle);
    gl.glDeleteShader(fragmentShaderHandle);
    gl.glDeleteProgram(program);
    if (shaders.get(Gdx.app) != null)
        shaders.get(Gdx.app).removeValue(this, true);
}