Hey fine Emscripten folks: I thought you might be interested in a test platform/game a few of my colleagues and I put together at
https://github.com/cookingclub/polarity It's the only open source Emscripten example that deals properly with context loss and restore as well as having all of SDL1, SDL2, and OpenGL build targets that all look identical in both WebGL and native under linux. It supports sprite rendering (with scaling, rotation and both per pixel with per-surface alpha), font rendering and lines. Compiled versions are available here: arrows to move, shift adjusts polarity: http://graphics.stanford.edu/~danielh/polarity/opengl/ and http://graphics.stanford.edu/~danielh/polarity/sdl/ and http://graphics.stanford.edu/~danielh/polarity/opengl/?debug=1 if you want to test Lose WebGL context in N calls We'd love it if anyone was able to use this as a starting point for their own future projects that were significantly more cross platform than other examples out there and properly handled context loss. Comments/Suggestions are appreciated! -Daniel PS: emscripten needs a number of simple one-line bug fixes to properly support context loss and restore and 1 simple fix to support font rendering under OpenGL. https://github.com/cookingclub/polarity/blob/master/emscripten_bugs.txt Luckily javascript is flexible enough that the bugfixes can be monkeypatched in during runtime :-) which we do PPS: I hope y'all keep the amazing support for the canvas-based libSDL in emscripten. It would be unfortunate to require WebGL for graphical emscripten apps. Or that if y'all go to SDL2 that you make it backed by canvas instead of WebGL (that's what the OpenGL target is for). -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
