Skip to content

Instantly share code, notes, and snippets.

View williamahartman's full-sized avatar

Will Hartman williamahartman

  • Hitachi Vantara
  • MA
View GitHub Profile
@williamahartman
williamahartman / FrameRate.java
Created January 15, 2015 03:17
Display framerate in a LibGDX graphics window. Call update() and render() in your main render method.
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.utils.TimeUtils;
/**
* A nicer class for showing framerate that doesn't spam the console
* like Logger.log()