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

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

Introduction

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

Prototype

int GL_DEPTH_BUFFER_BIT

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

Click Source Link

Usage

From source file:sink.demo.scene3d.Scene3dDesktop.java

License:Apache License

@Override
public void render() {
    //Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    stage2d.act();/*ww  w.j ava 2 s. com*/
    stage2d.draw();
    stage3d.act();
    stage3d.draw();
    camController.update();
    fpsText.setText("Fps: " + Gdx.graphics.getFramesPerSecond());
}

From source file:worksimproto.GameScreen.java

@Override
public void render(float delta) {
    // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    int xcnt = 0, ycnt = 0;
    Gdx.gl10.glClearColor(0.0f, 0.0f, 0.0f, 1);
    Gdx.gl10.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
    // each letter is 8x8 pixels
    Gdx.gl10.glColor4f(1, .5f, 1, .5f);//from  w  ww  .j  a  v a2s  . c  o m
    gl.getTRender().printText(gButtons.get(0).getText(), gButtons.get(0).getXPos(), gButtons.get(0).getYPos());
    gl.getTRender().printText(gButtons.get(1).getText(), gButtons.get(1).getXPos(), gButtons.get(1).getYPos());
    gl.getTRender().printText(gButtons.get(2).getText(), gButtons.get(2).getXPos(), gButtons.get(2).getYPos());
    gl.getTRender().printText(gButtons.get(3).getText(), gButtons.get(3).getXPos(), gButtons.get(3).getYPos());
    gl.getTRender().printText(gButtons.get(4).getText(), gButtons.get(4).getXPos(), gButtons.get(4).getYPos());

    gl.getTRender().printText("NAME", 10, 600);
    misc = Integer.toString(gl.getMoney());
    misc = misc.substring(0, misc.length() - 2) + "." + misc.substring(misc.length() - 2, misc.length());
    gl.getTRender().printText("MONEY" + " " + "$" + misc, 600, 600);
    if (gl.getSelectedHire() != null) {
        gl.getTRender().printText(gl.getSelectedHire().getFName().toUpperCase() + " "
                + gl.getSelectedHire().getLName().toUpperCase(), 50, 600);
    }

    if (!gl.getEmployees().isEmpty()) {
        xcnt = 0;
        ycnt = 0;
        for (Employee e : gl.getEmployees()) {
            gl.getTRender().printText(e.getFName().toUpperCase() + " " + e.getLName().toUpperCase(), 300,
                    600 - ycnt);
            ycnt += 10;
        }
    }

    gl.getTRender().printText(gl.getWeek().getDay(gl.getCurrentDay()).getDayName().toUpperCase(), 300, 50);
    gl.getTRender().printText(gl.getCurrentTime() + "", 300, 40);
}