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

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

Introduction

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

Prototype

public void glDeleteProgram(int program);

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);// ww w  . j  ava2s  .  c om
    gl.glDeleteShader(vertexShaderHandle);
    gl.glDeleteShader(fragmentShaderHandle);
    gl.glDeleteProgram(program);
    if (shaders.get(Gdx.app) != null)
        shaders.get(Gdx.app).removeValue(this, true);
}