Created
January 24, 2018 08:29
-
-
Save iampava/3611eb61995b81fb60b3ba6423e618db to your computer and use it in GitHub Desktop.
Small snippet showing how to use the "requestAnimationFrame" function to do some work every frame.
This file contains hidden or 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
paint(); | |
function paint() { | |
//This function gets called every frame | |
window.requestAnimationFrame(paint); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment