Example usage for com.badlogic.gdx.graphics GL10 GL_STENCIL_BUFFER_BIT

List of usage examples for com.badlogic.gdx.graphics GL10 GL_STENCIL_BUFFER_BIT

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics GL10 GL_STENCIL_BUFFER_BIT.

Prototype

int GL_STENCIL_BUFFER_BIT

To view the source code for com.badlogic.gdx.graphics GL10 GL_STENCIL_BUFFER_BIT.

Click Source Link

Usage

From source file:application.concretion.GameScreenController.java

License:Open Source License

@Override
public void render() {
    //   log.log();
    // Clean the screen
    Gdx.gl.glClearColor(1, 1, 1, 1);//ww w .j  av  a2 s. c  o m
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT | GL10.GL_STENCIL_BUFFER_BIT);

    // Update and draw the screen
    currentScreen.update(Gdx.graphics.getDeltaTime());
    currentScreen.draw(Gdx.graphics.getDeltaTime());

    // Check if the current screen is done and set the next screen if return
    // null means that is not done
    nextScreen = currentScreen.nextScreen();
    if (nextScreen != null) {
        // Dispose the resources of the current screen
        currentScreen.dispose();
        // Set the next screen
        currentScreen = nextScreen;
    }
}

From source file:com.hajnar.GravityShip.Screens.GameScreen.java

License:Apache License

@Override
public void render(float delta) {

    if (gameWorld.getState() != GameWorld.WORLD_PAUSED) {
        gameWorld.update(delta);/*  w  w w. j  a v  a2 s  . c o  m*/
    }

    if (gameWorld.getState() == GameWorld.WORLD_RUNNING)
        levelDuration += delta;
    else if (gameWorld.getState() == GameWorld.WORLD_GAME_OVER)
        gameoverDuration += delta;

    Gdx.gl.glClearColor(0f, 0f, 0f, 1);
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_STENCIL_BUFFER_BIT);

    if (GravityShip.deviceType == GravityShip.DEV_TYPE_DESKTOP)
        worldRender.renderDesktop(delta);
    else
        worldRender.renderAndroid(delta);

    switch (gameWorld.getState()) {
    case GameWorld.WORLD_RUNNING:
        renderOnScreenControlsAndInfo();
        break;
    case GameWorld.WORLD_GAME_OVER:
        if (gameoverDuration > 1.5f)
            renderGameOverMenu();
        break;
    case GameWorld.WORLD_NEXT_LEVEL:
        renderNextLevelMenu();
        break;
    case GameWorld.WORLD_PAUSED:
        renderPauseMenu();
        break;
    }
}