List of usage examples for com.badlogic.gdx.graphics GL20 GL_DEPTH_BUFFER_BIT
int GL_DEPTH_BUFFER_BIT
To view the source code for com.badlogic.gdx.graphics GL20 GL_DEPTH_BUFFER_BIT.
Click Source Link
From source file:com.mygdx.game.gameword.GameRenderer.java
public void renderWait(float delta) { Gdx.gl.glClearColor(0, 0, 0, 0);/* w w w. j a v a 2s . c o m*/ Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); batch.begin(); wait.draw(batch, "Veuillez appuyer sur n'importe quelle touche pour lancer le jeu !", (Gdx.graphics.getWidth() / 2) - (waitWidth / 2), (Gdx.graphics.getHeight() / 2) + (waitHeight / 2)); batch.end(); }
From source file:com.mygdx.game.gameword.touchme.TouchMeRenderer.java
@Override public void render(float delta) { Gdx.gl.glClearColor(0, 0, 0, 0);/* w w w . ja v a2 s . com*/ Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); dessinerCheckPoints(delta); dessinerSegments(); }
From source file:com.mygdx.game.screens.touchme.GenererPartieTouchMeScreen.java
@Override public void render(float delta) { Gdx.gl.glClearColor(0, 0, 0, 0);// w w w .j av a 2 s . co m Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); batch.begin(); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); batch.end(); }
From source file:com.nsoft.boxuniverse.main.Game.java
License:Open Source License
@Override public void render() { if (isReady) { Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); world.render();//from w ww . j ava 2s . c o m } }
From source file:com.pixelscientists.gdx.inventory.InventoryScreen.java
License:Open Source License
@Override public void render(float delta) { Gdx.gl.glClearColor(0.2f, 0.2f, 0.2f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); if (Gdx.input.isKeyPressed(Input.Keys.ANY_KEY)) { inventoryActor.setVisible(true); }//from w ww. ja v a 2 s.c om stage.act(delta); stage.draw(); }
From source file:com.pixelscientists.gdx.splash.SplashScreen.java
License:Open Source License
@Override public void render(float deltaTime) { if (LibgdxUtils.assets.update() && minimumShowTime <= 0) { LibgdxUtils.game.setScreen(new InventoryScreen()); }/*from w w w . j a v a 2 s . c om*/ Gdx.gl.glClearColor(0.15f, 0.15f, 0.15f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); LibgdxUtils.spriteBatch.setProjectionMatrix(camera.combined); LibgdxUtils.spriteBatch.begin(); LibgdxUtils.spriteBatch.draw(splash, 0, 0); LibgdxUtils.spriteBatch.end(); minimumShowTime -= deltaTime; }
From source file:com.qualcomm.vuforia.samples.libGDX.screens.ChooseBallScreen.java
License:Apache License
@Override public void render() { if (app.joinServerScreen.join != null) { if (!app.joinServerScreen.join.isAlive()) { app.joinServerScreen.join = null; app.mainMenyScreen = new MainMenyScreen(app); app.setScreen(app.mainMenyScreen); }/*from w w w. j a va 2 s . co m*/ if (app.joinServerScreen.join.getBallChosenState()) { for (int i = 0; i < ballNames.size; i++) { Model tmpModel = assets.get("3d/balls/" + ballNames.get(i) + ".g3db", Model.class); for (int k = 0; k < tmpModel.meshes.size; k++) tmpModel.meshes.get(k).scale(0.2f, 0.2f, 0.2f); } // switch(PropertiesSingleton.getInstance().getGameMode()) // { // case "standard": // app.gameScreen = new GameScreen(app); // app.setScreen(app.gameScreen); // break; // case "zombieMode": // // break; // case "coinRain": // // break; // case "team": // // break; // default: // break; // } PropertiesSingleton.getInstance().setRound(1); app.gameScreen = new GameScreen(app); app.setScreen(app.gameScreen); } } if (app.createServerScreen.create != null) if (app.createServerScreen.create.checkBallChosen() && app.createServerScreen.create.getSwitchScreen()) { for (int i = 0; i < ballNames.size; i++) { Model tmpModel = assets.get("3d/balls/" + ballNames.get(i) + ".g3db", Model.class); for (int k = 0; k < tmpModel.meshes.size; k++) tmpModel.meshes.get(k).scale(0.2f, 0.2f, 0.2f); } // switch(PropertiesSingleton.getInstance().getGameMode()) // { // case "standard": // app.gameScreen = new GameScreen(app); // app.setScreen(app.gameScreen); // break; // case "zombieMode": // // break; // case "coinRain": // // break; // case "team": // // break; // default: // break; // } PropertiesSingleton.getInstance().setRound(1); app.gameScreen = new GameScreen(app); app.setScreen(app.gameScreen); } fps.log(); Gdx.gl.glClearColor(0, 0, 0, 0f); Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); final float delta = Math.min(1f / 10f, Gdx.graphics.getDeltaTime()); rotation = rotation + 0.5f; if (rotation >= 360) rotation = 0; if (!loading) instances.get(currentBall).transform.setToRotation(0, 1, 0, rotation); cam.update(); modelBatch.begin(cam); if (!loading) modelBatch.render(instances.get(currentBall), environment); modelBatch.end(); shadowLight.begin(Vector3.Zero, cam.direction); shadowBatch.begin(shadowLight.getCamera()); if (!loading) shadowBatch.render(instances.get(currentBall)); shadowBatch.end(); shadowLight.end(); // Gdx.app.log("current", "" + currentBall); stage.act(); stage.draw(); }
From source file:com.qualcomm.vuforia.samples.libGDX.screens.ChooseIslandScreen.java
License:Apache License
@Override public void render() { if (app.joinServerScreen.join != null) { if (!app.joinServerScreen.join.isAlive()) { app.joinServerScreen.join = null; app.mainMenyScreen = new MainMenyScreen(app); app.setScreen(app.mainMenyScreen); }//from w w w. j av a 2 s .c o m if (app.joinServerScreen.join.getIslandChosenState()) app.setScreen(new ChooseBallScreen(app)); } if (app.createServerScreen.create != null) { if (app.createServerScreen.create.checkIslandChosen() && app.createServerScreen.create.getSwitchScreen() && app.createServerScreen.create.checkResponseReceived()) { PropertiesSingleton.getInstance() .initRandomCoinPosition(PropertiesSingleton.getInstance().getChosenIsland()); PropertiesSingleton.getInstance().setRandomCoinPosition(); app.createServerScreen.create.sendGemPosition(PropertiesSingleton.getInstance().getCoinPosition()); // PropertiesSingleton.getInstance().initRandomPowerupPosition(PropertiesSingleton.getInstance().getChosenIsland()); // PropertiesSingleton.getInstance().setRandomPowerupPosition(); // app.createServerScreen.create.sendPowerupPosition(PropertiesSingleton.getInstance().getPowerupPosition()); app.setScreen(new ChooseBallScreen(app)); } } fps.log(); Gdx.gl.glClearColor(0, 0, 0, 0f); Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); final float delta = Math.min(1f / 10f, Gdx.graphics.getDeltaTime()); rotation = rotation + 0.5f; if (rotation >= 360) rotation = 0; instances.get(currentIsland).transform.setToRotation(0, 1, 0, rotation); cam.update(); modelBatch.begin(cam); modelBatch.render(instances.get(currentIsland), environment); modelBatch.end(); // shadowLight.begin(Vector3.Zero, cam.direction); // shadowBatch.begin(shadowLight.getCamera()); // if(!loading) // shadowBatch.render(instances.get(currentIsland)); // shadowBatch.end(); // shadowLight.end(); // Gdx.app.log("current", "" + currentIsland); stage.act(); stage.draw(); }
From source file:com.retrom.volcano.game.WorldRenderer.java
License:Apache License
public void render(float deltaTime, boolean isPaused) { Gdx.graphics.getGL20().glClearColor(0, 0, 0, 1); Gdx.graphics.getGL20().glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); if (!isPaused) { cam_target = world.camTarget;//from www . j ava 2 s .co m if (cam_position < cam_target) { cam_position += (cam_target - cam_position) * deltaTime / 2; } else { cam_position += Math.min(-0.4, (cam_target - cam_position) * deltaTime * 1.7f); } cam.position.y = snapToY(cam_position); cam.position.x = world.quakeX; cam.update(); batch.setProjectionMatrix(cam.combined); } renderBackground(); renderObjects(); renderOverlay(); if (Gdx.input.isKeyJustPressed(Input.Keys.PLUS)) { offset += 1; } }
From source file:com.sasluca.lcl.applogic.appsystems.impl.LCLDefaultAppSystem.java
License:Apache License
@Override public void render(float delta) { //Set the delta and update the camera LCL.handleDelta(delta);/* ww w. j a v a 2s . co m*/ LCL.getCamera().update(); //Clear the screen Gdx.gl.glClearColor(BackgroundColor.r, BackgroundColor.g, BackgroundColor.b, BackgroundColor.a); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); //Initialize the OpenGL context LCL.startRendering(); if (p_UpdateTweenEngine) LCLTween.TWEEN_MANAGER.update(LCL.getDelta()); if (p_ManageKeyboard) LCLVirtualKeyboardManager.manage(); for (IRender renderable : p_RenderLayers) renderable.render(); for (IUpdate updatable : p_UpdateHandlers) updatable.update(); //Manage the current state manage(); //Flush the batch sending all the data to the GPU to be rendered LCL.endRendering(); }