Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get vsync callback on HTML5 canvas?

How can I vsync callback on HTML5 canvas?

like image 506
eonil Avatar asked May 17 '11 02:05

eonil


1 Answers

There's no such thing. The browser should take care of doing the appropriate syncs, and you can help it by using requestAnimationFrame() - see, for example, http://paulirish.com/2011/requestanimationframe-for-smart-animating/ and https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame.

like image 118
brainjam Avatar answered Oct 17 '22 23:10

brainjam