Hi,
Once I managed to get the build system configured correctly with CMake it was relatively straightforward. However, I have some questions:
1/ Currently rendering uses SDL surface and software rendering. For the SDL original, coding an OpenGL renderer yielded a decent performance improvement. Would I see a significant performance enhancement if I were to code a WebGL based renderer? Bear in mind I am simply blitting a 320x224 array of 32 bit values, and there is no 3D specific rendering. I don't want to spend a lot of time on this if the difference would be marginal.
2/ The Javascript version isn't running full-speed. I would say it's running at ~20fps, when I would be aiming for at least 30fps. I am compiling with -O2 and a selection of the -O3 options. Now I don't know very much about Javascript, so I profiled the code in Chrome's profiler. It reported that 80% of the time it was Idle.
Related to the above if I pass a value of zero, rather than 30, to the emscripten_set_main_loop call the engine runs at approximately 3x the expected speed.
Am I doing something weird/wrong? It feels like I should be getting 30fps, but for some reason passing the fps value is causing a weird slowdown problem that isn't noticeable when passing zero.
For what it's worth a few minor issues I found along the way:
- I had to manually change the key codes for the cursor keys.
- I'm not sure if the SDL surface RShift, GShift, BShift values are being set correctly. I had to set these manually.
I was impressed that the results even ran on my Samsung Galaxy S3 at a decent framerate.
Thanks,
Chris.