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

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

Introduction

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

Prototype

public void glClear(int mask);

Source Link

Usage

From source file:exodus.FinalScreen.java

@Override
public void render(float dt) {

    cam3d.translate(0.0f, -dt * scrollSpeed, 0.0f);
    cam3d.update(false);//  ww w. jav a 2 s  .c  om

    GL20 gl = Gdx.graphics.getGL20();
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    spriteBatch.setProjectionMatrix(cam3d.combined);
    spriteBatch.begin();
    bitmapFont.draw(spriteBatch, layout, -cam3d.viewportWidth / 2f, -cam3d.viewportHeight);
    spriteBatch.end();
}

From source file:io.developersguild.rebelinvader.screens.HighscoresScreen.java

License:Apache License

public void draw() {
    GL20 gl = Gdx.gl;
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    guiCam.update();//from w w w . j  a va 2s .  c  om

    game.batch.setProjectionMatrix(guiCam.combined);
    game.batch.disableBlending();
    game.batch.begin();
    game.batch.draw(Assets.bgNebulaRegion, 0, 0, 320, 1067);
    game.batch.end();

    game.batch.enableBlending();
    game.batch.begin();

    // This draws bottom to top
    float y = 130;
    for (int i = 9; i >= 0; i--) {
        Assets.font.draw(game.batch, highScores[i], xOffset, y);
        y += Assets.font.getLineHeight() * 2;
    }
    y += Assets.font.getLineHeight();
    Assets.font.draw(game.batch, "Highscores", xOffset, y);

    game.batch.end();
}

From source file:net.saga.mmstyle.screen.IntroScene.java

License:Open Source License

@Override
public void render(GL20 gl) {
    gl.glClearColor(1, 1, 1, 1);//from  ww  w  . j  a  v  a2 s  . c  om
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    batch.begin();
    font.draw(batch, "Hello World", 200, 200);
    batch.end();
}