public void render (boolean update) { fpsCounter.put(Gdx.graphics.getFramesPerSecond()); if (update) update(); beginRender(true); renderWorld(); Gdx.gl.glDisable(GL20.GL_DEPTH_TEST); if (debugMode != DebugDrawModes.DBG_NoDebug) world.setDebugMode(debugMode); Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); performance.setLength(0); performance.append("FPS: ").append(fpsCounter.value).append(", Bullet: ") .append((int)(performanceCounter.load.value * 100f)).append("%"); }
public void toggleDebugMode () { if (world.getDebugMode() == DebugDrawModes.DBG_NoDebug) setDebugMode(DebugDrawModes.DBG_DrawWireframe | DebugDrawModes.DBG_DrawFeaturesText | DebugDrawModes.DBG_DrawText | DebugDrawModes.DBG_DrawContactPoints | DebugDrawModes.DBG_DrawConstraints); else if (world.renderMeshes) world.renderMeshes = false; else { world.renderMeshes = true; setDebugMode(DebugDrawModes.DBG_NoDebug); } }
@Override public void render(float delta) { camera.update(delta * GameSettings.CAMERA_LERP_ALPHA); stage.act(delta); delta *= GameSettings.GAME_SPEED; Gdx.gl.glClearColor(0, 0, 0, 1f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); viewportBackgroundRenderer.begin(ShapeRenderer.ShapeType.Filled); viewportBackgroundRenderer.setColor(viewportBackgroundColor); viewportBackgroundRenderer.rect(0, 0, viewport.getScreenWidth(), viewport.getScreenHeight()); viewportBackgroundRenderer.end(); engine.update(delta); renderer.update(delta); if (DebugViewSettings.drawCollShapes || DebugViewSettings.drawConstraints) { int mode = 0; if (DebugViewSettings.drawConstraints) { mode |= DebugDrawModes.DBG_DrawConstraints; mode |= DebugDrawModes.DBG_DrawConstraintLimits; } if (DebugViewSettings.drawCollShapes) { mode |= DebugDrawModes.DBG_DrawWireframe; } engine.setDebugMode(mode); engine.debugDrawWorld(camera); } stage.draw(); }
public void toggleDebugMode () { if (world.getDebugMode() == DebugDrawModes.DBG_NoDebug) setDebugMode(DebugDrawModes.DBG_DrawWireframe | DebugDrawModes.DBG_DrawFeaturesText | DebugDrawModes.DBG_DrawText | DebugDrawModes.DBG_DrawContactPoints); else if (world.renderMeshes) world.renderMeshes = false; else { world.renderMeshes = true; setDebugMode(DebugDrawModes.DBG_NoDebug); } }
public void render (boolean update) { if (update) update(); viewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); beginRender(true); renderWorld(); if (debugMode != DebugDrawModes.DBG_NoDebug) world.setDebugMode(debugMode); }