rezoner / CanvasQuery

Canvas for 2d gamedevelopers. Out of box canvas, keyboard, mouse, events.
http://canvasquery.com
586 stars 52 forks source link

Old browsers compatibility requestAnimationFrame #31

Closed bholota closed 9 years ago

bholota commented 10 years ago

While I was experimenting with raw WebView android wrapper I found out that CanvasQuery uses 'new' browsers feature - requestAnimationFrame, I don't know if it's intended but if it's not here is fix that I used (found in web): https://github.com/3mpty/android-unfinished-asteroids/blob/master/app/src/main/assets/unfinished-asteroids/script/Lib/CanvasQuery.js

Lines 14-37. Ofc. it's not best place for this code, it was just experiment, with that it should work on old androids and handicapped desktop browsers.

rezoner commented 10 years ago

I do appreciate and understand your reasoning but I've made a decision that I will not support older browser and devices. The shims and workarounds begin to stack over time and stays in the code for eternity and the devices that lack support for "new things" are too slow to run a decent game anyway - and CQ is a game-oriented library.

I will make an exception for requestAnimationFrame tho, since it is still not 100% propagated among browsers

bholota commented 10 years ago

That's why I was asking if it was intended or not. Backward compatibility in gamedev is no not nicest thing :)