Example usage for com.badlogic.gdx.graphics.glutils ShaderProgram dispose

List of usage examples for com.badlogic.gdx.graphics.glutils ShaderProgram dispose

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.glutils ShaderProgram dispose.

Prototype

public void dispose() 

Source Link

Document

Disposes all resources associated with this shader.

Usage

From source file:airfoil.Main.java

License:Open Source License

@Override
public void dispose() {

    ShaderProgram bodyShader = this.bodyShader;
    if (null != bodyShader) {
        this.bodyShader = null;
        bodyShader.dispose();
    }// w  w  w  . j ava  2 s  .c om

    ShaderProgram axesShader = this.axesShader;
    if (null != axesShader) {
        this.axesShader = null;
        axesShader.dispose();
    }
}

From source file:com.cyphercove.lwptools.core.GaussianBlurShaderProvider.java

License:Apache License

boolean disposeShader(ShaderProgram shaderProgram) {
    if (shaderProgram == null)
        return false;

    for (IntMap.Entry<UniqueShader> entry : blurPassShaderPrograms.entries()) {
        UniqueShader uniqueShader = entry.value;
        if (uniqueShader.shaderProgram == shaderProgram) {
            uniqueShader.refCount--;//from w  ww . ja  va2  s  . c  om
            if (uniqueShader.refCount < 1) {
                shaderProgram.dispose();
                blurPassShaderPrograms.remove(entry.key);
                return true;
            } else {
                return false;
            }
        }
    }

    //not found!
    shaderProgram.dispose();
    return true;
}

From source file:com.kotcrab.vis.editor.module.project.ShaderCacheModule.java

License:Apache License

@Override
public void dispose() {
    watcherModule.removeListener(this);
    for (ShaderProgram shader : shaders.values()) {
        shader.dispose();
    }//from   w w w  .  ja v a2 s .  c om
}