Files
Upsilon/escher/include/escher/run_loop.h
Romain Goyet 67f082f4e8 [emscripten] Use emterpreter
This allows us to control the runloop
2018-02-01 14:10:26 +01:00

22 lines
394 B
C++

#ifndef ESCHER_RUN_LOOP_H
#define ESCHER_RUN_LOOP_H
#include <ion.h>
#include <escher/timer.h>
class RunLoop {
public:
RunLoop();
void run();
void runWhile(bool (*callback)(void * ctx), void * ctx);
protected:
virtual bool dispatchEvent(Ion::Events::Event e) = 0;
virtual int numberOfTimers();
virtual Timer * timerAtIndex(int i);
private:
bool step();
int m_time;
};
#endif