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

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

Introduction

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

Prototype

public void glEnable(int cap);

Source Link

Usage

From source file:airfoil.Main.java

License:Open Source License

@Override
public void render() {
    if (this.alive) {
        GLCommon gl = Gdx.gl;
        gl.glViewport(0, 0, this.width, this.height);
        gl.glClearColor(ColorClear.r, ColorClear.g, ColorClear.b, ColorClear.a);
        gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
        gl.glEnable(GL20.GL_DEPTH_TEST);
        gl.glDepthFunc(GL20.GL_LESS);//from  w w w. ja v a  2 s .  com

        /*
         */

        this.renderMeshLines(this.database.getMesh(this.geometry));

    }
}

From source file:com.dgcgames.balloonblast.GameScreen.java

License:Apache License

@Override
public void present(float deltaTime) {
    GLCommon gl = Gdx.gl;
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    gl.glEnable(GL10.GL_TEXTURE_2D);

    renderer.render();//from w w  w.  j a  va 2 s . c  o m

    guiCam.update();
    batcher.setProjectionMatrix(guiCam.combined);
    batcher.enableBlending();
    batcher.begin();
    switch (state) {
    case GAME_READY:
        presentReady();
        break;
    case GAME_RUNNING:
        presentRunning();
        break;
    case GAME_PAUSED:
        presentPaused();
        break;
    case GAME_LEVEL_END:
        presentLevelEnd();
        break;
    case GAME_OVER:
        presentGameOver();
        break;
    }
    batcher.end();
}

From source file:com.dgcgames.balloonblast.HelpScreen.java

License:Apache License

@Override
public void present(float deltaTime) {
    GLCommon gl = Gdx.gl;
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    guiCam.update();/*w w  w  .ja v a 2  s .  c o m*/
    guiCam.apply(Gdx.gl10);

    gl.glEnable(GL10.GL_TEXTURE_2D);

    batcher.disableBlending();
    batcher.begin();
    batcher.draw(helpRegion, 0, 0, 1024, 768);
    batcher.end();

    batcher.enableBlending();
    batcher.begin();
    //batcher.draw(Assets.arrow, 320, 0, -64, 64);
    batcher.end();

    gl.glDisable(GL10.GL_BLEND);
}

From source file:com.dgcgames.balloonblast.HighscoresScreen.java

License:Apache License

@Override
public void present(float deltaTime) {
    GLCommon gl = Gdx.gl;
    gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    guiCam.update();/*from  ww  w . j a v  a2s . c  om*/
    guiCam.apply(Gdx.gl10);

    gl.glEnable(GL10.GL_TEXTURE_2D);

    batcher.disableBlending();
    batcher.begin();
    batcher.draw(Assets.backgroundRegion, 0, 0, 1024, 768);
    batcher.end();

    batcher.enableBlending();
    batcher.begin();
    batcher.draw(Assets.highScoresRegion, 400, 360 - 18, 300, 33);

    float y = 230;
    for (int i = 4; i >= 0; i--) {
        Assets.font.draw(batcher, highScores[i], xOffset, y);
        y += Assets.font.getLineHeight();
    }

    //batcher.draw(Assets.arrow, 0, 0, 64, 64);
    //batcher.draw(Assets.balloon, 0, 0, 64, 64);
    batcher.end();
}