-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinvaders.h
44 lines (34 loc) · 1.11 KB
/
invaders.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef CLASS_MYEVENTHANDLER
#define CLASS_MYEVENTHANDLER
#include <ncine/IAppEventHandler.h>
#include <ncine/IInputEventHandler.h>
#include <nctl/UniquePtr.h>
namespace ncine {
class AppConfiguration;
}
namespace nc = ncine;
class Game;
/// My nCine event handler
class MyEventHandler :
public nc::IAppEventHandler,
public nc::IInputEventHandler
{
public:
void onPreInit(nc::AppConfiguration &config) override;
void onInit() override;
void onFrameStart() override;
#ifdef __ANDROID__
virtual void onTouchDown(const nc::TouchEvent &event) override;
virtual void onTouchUp(const nc::TouchEvent &event) override;
#endif
void onKeyPressed(const nc::KeyboardEvent &event) override;
void onKeyReleased(const nc::KeyboardEvent &event) override;
void onMouseButtonPressed(const nc::MouseEvent &event) override;
void onMouseButtonReleased(const nc::MouseEvent &event) override;
void onJoyMappedButtonPressed(const nc::JoyMappedButtonEvent &event) override;
void onJoyMappedButtonReleased(const nc::JoyMappedButtonEvent &event) override;
private:
nctl::UniquePtr<Game> game_;
bool shouldStop_ = true;
};
#endif