Commit Graph

1 Commits

Author SHA1 Message Date
Robert Bragg
9ef37423fc emscripten-hello: improve mainloop integration
Instead of simply relying on the emscripten mainloop api to wake us up
periodically so that we can poll for SDL events we now pause the
emscripten mainloop whenever no redraw is queued and instead hook an
input event listener into the real browser mainloop to resume the
emscripten mainloop whenever input is received. This way the example
can go to sleep while there's no input to handle.

This provides a simple example of binding custom javascript into native
code.

Reviewed-by: Neil Roberts <neil@linux.intel.com>

(cherry picked from commit a8b1e2eda491dc7c44c84cd47e160c7b8ba0f792)
2013-05-29 19:30:44 +01:00