-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCApp.h
109 lines (68 loc) · 1.76 KB
/
CApp.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//==============================================================================
// SDL Tutorial 1
//==============================================================================
#ifndef _CAPP_H_
#define _CAPP_H_
#include <SDL.h>
#include "Define.h"
#include "CText.h"
#include "CArea.h"
#include "CCamera.h"
#include "CEvent.h"
#include "CSurface.h"
#include "CTileWindow.h"
#include "CText.h"
#include "string"
#include "CApp.h"
#include "SDL.h"
#include "SDL_ttf.h"
#include "CSurface.h"
//==============================================================================
class StringInput
{
private:
std::string str;
SDL_Surface* text;
public:
static StringInput input;
StringInput();
~StringInput();
void handle_input();
void OnRender(SDL_Surface* Surf_Display);
};
class CApp : public CEvent
{
private:
bool Running;
bool isTyping;
SDL_Surface* Surf_Display;
SDL_Surface* Surf_Overlay;
CTile* tile;
CMap* Map;
void GetTile(int mX, int mY);
public:
CApp();
CTileWindow TileWindow;
int newTileID;
int newTypeID;
bool down;
int mXold;
int mYold;
SDL_Rect overlay;
int OnExecute();
public:
bool OnInit();
void OnEvent(SDL_Event* Event);
void OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);
void OnLButtonDown(int mX, int mY);
void OnRButtonDown(int mX, int mY);
void OnRButtonUp(int mX, int mY);
void OnMouseMove(int mX, int mY, int relX, int relY, bool Left,bool Right,bool Middle);
void OnExit();
void OnLoop();
void OnRender();
bool OnCleanup();
bool InBounds(int mX, int mY);
};
//==============================================================================
#endif