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

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

Introduction

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

Prototype

int GL_FRONT

To view the source code for com.badlogic.gdx.graphics GL20 GL_FRONT.

Click Source Link

Usage

From source file:com.perfectplay.org.SkyBox.java

License:Open Source License

public void render(PerspectiveCamera camera) {
    invView.set(camera.view);// ww  w  .  j  ava2s. com

    // Remove translation
    invView.val[Matrix4.M03] = 0;
    invView.val[Matrix4.M13] = 0;
    invView.val[Matrix4.M23] = 0;

    invView.inv().tra();

    mvp.set(camera.projection);
    mvp.mul(invView);

    Gdx.gl.glEnable(GL20.GL_CULL_FACE);
    Gdx.gl.glCullFace(GL20.GL_FRONT);
    Gdx.gl.glFrontFace(GL20.GL_CCW);

    Gdx.gl20.glDisable(GL20.GL_BLEND);
    Gdx.gl20.glDisable(GL20.GL_DEPTH_TEST);
    Gdx.gl20.glDepthMask(false);

    Gdx.gl20.glActiveTexture(GL20.GL_TEXTURE0);
    Gdx.gl20.glBindTexture(GL20.GL_TEXTURE_CUBE_MAP, g_cubeTexture);

    program.begin();

    program.setUniformMatrix("u_mvpMatrix", mvp);
    program.setUniformi("s_cubemap", 0);

    cube.render(program, GL20.GL_TRIANGLE_STRIP);

    program.end();

    Gdx.gl.glEnable(GL20.GL_DEPTH_TEST);
    Gdx.gl.glDepthMask(true);
}