Example usage for com.badlogic.gdx.utils PerformanceCounters add

List of usage examples for com.badlogic.gdx.utils PerformanceCounters add

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils PerformanceCounters add.

Prototype

public PerformanceCounter add(final String name) 

Source Link

Usage

From source file:com.agateau.pixelwheels.GameWorld.java

License:Open Source License

public GameWorld(PwGame game, GameInfo gameInfo, PerformanceCounters performanceCounters) {
    mGame = game;//from w w w  .  java  2  s .  co m
    mBox2DWorld = new World(new Vector2(0, 0), true);
    mBox2DWorld.setContactListener(this);
    mTrack = gameInfo.getTrack();
    mTrack.init();
    mCountDown = new CountDown(this, game.getAudioManager(), game.getAssets().soundAtlas);

    mBox2DPerformanceCounter = performanceCounters.add("- box2d");
    mGameObjectPerformanceCounter = performanceCounters.add("- g.o");
    setupRacers(gameInfo.getEntrants());
    setupRoadBorders();
    setupBonusSpots();
    setupBonusPools();
}

From source file:com.agateau.pixelwheels.racescreen.GameRenderer.java

License:Open Source License

public GameRenderer(GameWorld world, Batch batch, PerformanceCounters counters) {
    mDebugRenderer = new Box2DDebugRenderer();
    mWorld = world;/* w w  w. j  av a  2s .co m*/

    mTrack = mWorld.getTrack();

    mExtraBackgroundLayerIndexes = mTrack.getExtraBackgroundLayerIndexes();
    mForegroundLayerIndexes = mTrack.getForegroundLayerIndexes();

    mBatch = batch;
    mCamera = new OrthographicCamera();
    boolean singlePlayer = mWorld.getPlayerRacers().size == 1;
    mCameraUpdater = singlePlayer ? new SinglePlayerCameraUpdater(mWorld)
            : new MultiPlayerCameraUpdater(mWorld);
    mRenderer = new OrthogonalTiledMapRenderer(mTrack.getMap(), Constants.UNIT_FOR_PIXEL, mBatch);

    mTilePerformanceCounter = counters.add("- tiles");
    mGameObjectPerformanceCounter = counters.add("- g.o.");

    mDebugRenderer.setDrawVelocities(Debug.instance.drawVelocities);
}