| OLD | NEW |
| (Empty) |
| 1 #ifndef EVENTLOOP_H | |
| 2 #define EVENTLOOP_H | |
| 3 | |
| 4 #include <android_native_app_glue.h> | |
| 5 #include "jni/activity_handler.h" | |
| 6 #include "jni/context.h" | |
| 7 #include "jni/input_handler.h" | |
| 8 | |
| 9 class EventLoop { | |
| 10 public: | |
| 11 explicit EventLoop(android_app* application); | |
| 12 void Run(ActivityHandler* activityHandler, Context* context); | |
| 13 | |
| 14 protected: | |
| 15 void Activate(); | |
| 16 void Deactivate(); | |
| 17 void ProcessActivityEvent(int32_t command); | |
| 18 int32_t ProcessInputEvent(AInputEvent* event); | |
| 19 | |
| 20 static void ActivityCallback(android_app* application, int32_t command); | |
| 21 static int32_t InputCallback(android_app* application, AInputEvent* event); | |
| 22 | |
| 23 private: | |
| 24 bool enabled_; | |
| 25 bool quit_; | |
| 26 ActivityHandler* activity_handler_; | |
| 27 InputHandler* input_handler_; | |
| 28 android_app* application_; | |
| 29 }; | |
| 30 | |
| 31 #endif | |
| 32 | |
| OLD | NEW |