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

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

Introduction

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

Prototype

public void glClearColor(float red, float green, float blue, float alpha);

Source Link

Usage

From source file:dorkbox.tweenengine.demo.Launcher.java

License:Apache License

public void render() {
    tweenManager.update(Gdx.graphics.getDeltaTime());

    GL20 gl = Gdx.gl20;
    gl.glClearColor(1, 1, 1, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    gl.glEnable(GL20.GL_BLEND);// w w w.j  ava2 s . c o m
    gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

    int w = Gdx.graphics.getWidth();
    int h = Gdx.graphics.getHeight();

    if (selectedTile == null) {
        batch.getProjectionMatrix().setToOrtho2D(0, 0, w, h);
        batch.begin();
        batch.disableBlending();
        background.draw(batch);
        batch.end();

        batch.setProjectionMatrix(camera.combined);
        batch.begin();
        batch.enableBlending();
        for (int i = 0; i < tiles.size(); i++) {
            tiles.get(i).draw(batch);
        }
        batch.end();

        batch.getProjectionMatrix().setToOrtho2D(0, 0, w, h);

        batch.begin();
        batch.disableBlending();
        title.draw(batch);
        titleLeft.draw(batch);
        titleRight.draw(batch);
        batch.enableBlending();

        if (veil.getColor().a > 0.1f) {
            veil.draw(batch);
        }
        batch.end();

    } else {
        selectedTile.getTest().render();
    }
}

From source file:dorkbox.tweenengine.demo.SplashScreen.java

License:Apache License

public void render() {
    tweenManager.update(Gdx.graphics.getDeltaTime());

    if (gdx.getRotation() > 360 * 15 - 20) {
        gdx.setRegion(gdxTex);/*from   w w w.  j  a va 2s.  c  o  m*/
    }

    GL20 gl = Gdx.gl20;
    gl.glClearColor(0, 0, 0, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    gl.glEnable(GL20.GL_BLEND);
    gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);

    batch.setProjectionMatrix(camera.combined);
    batch.begin();
    strip.draw(batch);
    universal.draw(batch);
    tween.draw(batch);
    engine.draw(batch);
    logo.draw(batch);
    powered.draw(batch);
    gdx.draw(batch);

    if (veil.getColor().a > 0.1f) {
        veil.draw(batch);
    }
    batch.end();

    if (finishedAnimation) {
        callback.onEvent(null);
    }
}

From source file:Exemplos.JanelaExemplo.java

@Override
public void render(float delta) {
    GL20 gl = Gdx.gl;
    gl.glClearColor(0, 0, 0, 1);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    camera.update();/*from w ww  .  j  ava2 s . c om*/
    estagio.act(Gdx.graphics.getDeltaTime());

    estagio.draw();

}

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);
    gl.glClear(GL20.GL_COLOR_BUFFER_BIT);

    batch.begin();//w  w  w . ja  v a 2s .  co m
    font.draw(batch, "Hello World", 200, 200);
    batch.end();
}