-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.h
48 lines (40 loc) · 787 Bytes
/
Window.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
#ifndef WINDOW_H
#define WINDOW_H
class Window {
static Window* instance;
public:
int t1, t2, quit, frames, rc;
double delta, worldTime, fpsTimer, fps;
Text temp;
SDL_Event event;
SDL_Surface *screen, *charset;
SDL_Surface *brickParts[7];
SDL_Surface *tetrisLogo;
SDL_Texture *scrtex;
SDL_Window *window;
SDL_Renderer *renderer;
Game *game;
BrickType *brickTypes[7];
DialogBox *dialogBox;
Ranking *ranking;
#ifdef DEBUG_MODE
Debug *debug;
#endif
int init();
void loop();
void renderWindow();
void pollEvents();
void quitWindow();
void showWindow(DialogBoxType type);
static Window* getInstance() {
if (!instance) initInstance();
return instance;
}
~Window();
protected:
Window();
static void initInstance() {
instance = new Window;
}
};
#endif