mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 03:29:58 +02:00
[ion] Initial emscripten support
Change-Id: Id76a45c5c723fae11387e20458bc9555689b9a48
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user