Created
December 4, 2014 23:53
-
-
Save awstanley/ce86755b4de7a057c4fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double delta = 0.0f; | |
double time_now = glfwGetTime(); | |
double time_last = glfwGetTime(); | |
while(my_running_boolean) | |
{ | |
time_now = glfwGetTime(); | |
delta = (time_now - time_last); | |
time_last = time_now; | |
// Sample object (you want everything to use delta updates) | |
arbitrary_object->update(delta); | |
// logic | |
// render | |
// poll events (this sample assumes callbacks) | |
glfwPollEvents(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment