OLD | NEW |
(Empty) | |
| 1 #ifndef EVENTLOOP_H |
| 2 #define EVENTLOOP_H |
| 3 |
| 4 #include <android_native_app_glue.h> |
| 5 #include "activity_handler.h" |
| 6 #include "input_handler.h" |
| 7 #include "context.h" |
| 8 |
| 9 class EventLoop { |
| 10 public: |
| 11 EventLoop(android_app* pAPplication); |
| 12 void run(ActivityHandler* pActivityHandler, |
| 13 Context* pContext); |
| 14 |
| 15 protected: |
| 16 void activate(); |
| 17 void deactivate(); |
| 18 void processActivityEvent(int32_t pCommand); |
| 19 int32_t processInputEvent(AInputEvent* pEvent); |
| 20 |
| 21 static void activityCallback(android_app* pApplication, int32_t pCommand); |
| 22 static int32_t inputCallback(android_app* pApplication, |
| 23 AInputEvent* pEvent); |
| 24 private: |
| 25 bool mEnabled; |
| 26 bool mQuit; |
| 27 ActivityHandler *mActivityHandler; |
| 28 InputHandler *mInputHandler; |
| 29 android_app* mApplication; |
| 30 }; |
| 31 |
| 32 #endif |
| 33 |
OLD | NEW |