Wolfos

Untitled

Mar 6th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.28 KB | None | 0 0
  1. //lastFrameTime is an integer, which works as a boolean in C.
  2. if(!lastFrameTime){
  3.     lastFrameTime = glutGet(GLUT_ELAPSED_TIME);
  4. }
  5. int now = glutGet(GLUT_ELAPSED_TIME);
  6. int elapsedMilliseconds = now - lastFrameTime;
  7. float deltaTime = elapsedMilliseconds / 1000.0f;
  8. lastFrameTime = now;
Advertisement
Add Comment
Please, Sign In to add comment