[ion] Initial emscripten support

Change-Id: Id76a45c5c723fae11387e20458bc9555689b9a48
This commit is contained in:
Romain Goyet
2016-11-06 12:06:02 +01:00
parent 3702af0f11
commit ade7f0480b
4 changed files with 93 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
#include <escher/container.h>
#include <ion/display.h>
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
Container::Container() :
m_activeApp(nullptr)
@@ -23,9 +26,13 @@ void Container::run() {
m_window.setFrame(KDRect(0, 0, Ion::Display::Width, Ion::Display::Height));
m_window.redraw();
#ifdef __EMSCRIPTEN__
emscripten_set_main_loop_arg([](void * ctx){ ((Container *)ctx)->step(); }, this, 0, 1);
#else
while (true) {
step();
}
#endif
}
void Container::step() {