Example usage for com.badlogic.gdx.graphics GLCommon glDepthMask

List of usage examples for com.badlogic.gdx.graphics GLCommon glDepthMask

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GLCommon glDepthMask.

Prototype

public void glDepthMask(boolean flag);

Source Link

Usage

From source file:com.balloongame.handlers.CustomSpriteBatch.java

License:Apache License

/** Finishes off rendering. Enables depth writes, disables blending and texturing. Must always be called after a call to
 * {@link #begin()} *//*from   w  w  w. ja v  a 2 s  .  c  o  m*/
public void end() {
    if (!drawing)
        throw new IllegalStateException("SpriteBatch.begin must be called before end.");
    if (idx > 0)
        renderMesh();
    lastTexture = null;
    idx = 0;
    drawing = false;

    GLCommon gl = Gdx.gl;
    gl.glDepthMask(true);
    if (isBlendingEnabled())
        gl.glDisable(GL10.GL_BLEND);

    if (Gdx.graphics.isGL20Available()) {
        if (customShader != null)
            customShader.end();
        else
            shader.end();
    } else {
        gl.glDisable(GL10.GL_TEXTURE_2D);
    }
}

From source file:com.jwatson.omnigame.graphics.CustomBatch.java

License:Apache License

/** Finishes off rendering. Enables depth writes, disables blending and texturing. Must always be called after a call to
 * {@link #begin()} *//*from   w w  w  .  ja  va2 s  .  co m*/
public void end() {
    if (!drawing)
        throw new IllegalStateException("CustomBatch.begin must be called before end.");
    if (idx > 0)
        renderMesh();
    lastTexture = null;
    idx = 0;
    drawing = false;

    GLCommon gl = Gdx.gl;
    gl.glDepthMask(true);
    if (isBlendingEnabled())
        gl.glDisable(GL10.GL_BLEND);

    if (Gdx.graphics.isGL20Available()) {
        if (customShader != null)
            customShader.end();
        else
            shader.end();
    } else {
        gl.glDisable(GL10.GL_TEXTURE_2D);
    }
}

From source file:com.kingx.dungeons.graphics.cube.CubeRenderer.java

License:Apache License

/**
 * Finishes off rendering. Enables depth writes, disables blending and
 * texturing. Must always be called after a call to {@link #begin()}
 *///from  ww w  .  j  a va2 s .  c  o  m
public void end() {
    if (!drawing)
        throw new IllegalStateException("SpriteBatch.begin must be called before end.");
    if (idx > 0)
        renderMesh();
    idx = 0;
    drawing = false;

    GLCommon gl = Gdx.gl;
    gl.glDepthMask(true);
    if (isBlendingEnabled())
        gl.glDisable(GL10.GL_BLEND);

    if (customShader != null)
        customShader.end();
    else
        shader.end();

}