Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static float getTime()
- {
- return (Sys.getTime() * 1000) / Sys.getTimerResolution();
- }
- public static float getDeltaTime()
- {
- return delta;
- }
- private void displayDelta()
- {
- if (getTime() - lastFps > 1000)
- {
- Display.setTitle("Dino Pizza Attack! FPS: " + fps);
- fps = 0;
- lastFps += 1000;
- }
- fps++;
- }
- // Straight code which calculates delta
- // This code goes inside of my main update() loop
- time = getTime();
- delta = time - lastFrame;
- lastFrame = time;
Advertisement
Add Comment
Please, Sign In to add comment