I’m currently working on a javascript canvas 2D game engine and I’m having some issues regarding requestAnimFrame.
It seems to me that I’m doing it correctly but after some time I get the following error (Uncaught RangeError: Maximum call stack size exceeded)
You can take a look of the source here: http://snipt.org/vxij1
My guess is that this line:
should be this:
so that your callback is called later as a callback, not executed immediately.