3 ms·
Can someone summarize the impact (no pun intended) of this?
by wensing 16y ago
Can someone summarize the impact (no pun intended) of this?
- maushu 16y agoMake multimedia software, generally games, for iPhone/iPod Touch/iPad using javascript and html5 canvas and make it run almost as fast as a native version.
- teamonkey 16y agoIt is a native app: it uses JavaScriptCore and all Canvas calls are rendered using OpenGL. The implications are that if you write a game for Impact engine you can generate an iOS native app.
- revjx 16y agoIt's not quite that simple, though, from the sound of it - the author said he had to 'reimplement' all the canvas calls to use OGL. Fine if you're familiar with it, but for those people who just want to bash out a Javascript game without having to worry about the engine, they might have trouble.
- pirko 16y agoFrom what I understand he only had to re-implement the canvas calls in the game engine. "I of course had to make some changes to the engine, but the game source code is exactly the same as for the web version."
- deleted 16y ago[deleted]
- mkilling 16y agoIf this should ever go public there will sure as hell be an abstraction layer that translates API calls to canvas or OpenGL ES, respectively
- phoboslab 16y agoSo far I only reimplemented those Canvas API functions needed for the game; the most important one being .drawImage(). What I mean by "reimplement", is providing a .drawImage function for JavaScript that works in the same way as it does in the browser, but uses OpenGL-ES behind the scenes. This reimplementation is done in native Objective C. The changes I had to make to Impact (the "HTML5" engine) are concerned with the loading of images, scaling, input and getting a reference to the canvas element and its drawing context. But I guess I could provide a dummy "document" and "getElementById" function, so that you can just write some JavaScript using Canvas and run it in the browser and on the iPhone unchanged. Note that this whole idea isn't exactly new: http://www.youtube.com/watch?v=0UN2iYrZmEY http://www.youtube.com/watch?v=0UN2iYrZmEY
- st3fan 16y agoSee my comment about not being able to use compiled/jitted javascript from apps because of code execution restrictions set by iOS.