-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyWindow.h
66 lines (49 loc) · 1.13 KB
/
MyWindow.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
#ifndef WINDOW_H
#define WINDOW_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <vector>
#include <string>
#include "MyTexture.h"
#include "Renderable.h"
#include "Text.h"
class LScreen;
class LWindow
{
public:
// Intializes internals
LWindow(int width, int height);
void begin();
// Handles window events
void handleEvent(SDL_Event &e);
// Window dimensions
int getWidth();
int getHeight();
// Window focii
bool hasMouseFocus();
bool hasKeyboardFocus();
bool isMinimized();
bool loadTexture(LTexture &texture, std::string path);
bool loadText(LTexture &texture, std::string txt, TTF_Font *font, SDL_Color textColor);
void setCurrScreen(LScreen *screen);
LScreen *getCurrScreen();
void maximize();
void restore();
private:
bool initLibs();
void cleanUp();
// Window data
SDL_Window *mWindow;
SDL_Renderer *mRenderer;
LScreen *mCurrScreen;
// Window dimensions
int mWidth;
int mHeight;
int FPS;
// Window focus
bool mMouseFocus;
bool mKeyboardFocus;
bool mFullScreen;
bool mMinimized;
};
#endif