-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.hpp
53 lines (41 loc) · 1.06 KB
/
window.hpp
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
#pragma once
#ifndef WINDOW_HPP
#define WINDOW_HPP
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#include <SDL_mixer.h>
#include "font.hpp"
inline extern const unsigned int SCREEN_WIDTH = 800;
inline extern const unsigned int SCREEN_HEIGHT = 600;
#ifdef DEBUG
#include <iostream>
#endif
class Window {
private:
static Window* _instance;
unsigned int _height;
unsigned int _width;
bool _mouseFocus;
bool _keyboardFocus;
bool _fullScreen;
bool _minimized;
bool _quit;
public:
SDL_Window* _window;
SDL_Renderer* _renderer;
const unsigned int& getWidth() const;
const unsigned int& getHeight() const;
const bool& getMouseFocus() const;
const bool& getKeyboardFocus() const;
const bool& getFullscreen() const;
const bool& getMinimized() const;
const bool& getQuit() const;
Window(const unsigned width = SCREEN_WIDTH, const unsigned height = SCREEN_HEIGHT);
~Window();
bool init();
void loadingScreen() const;
static Window* getInstance();
void handleWindowEvent(SDL_Event& e);
};
#endif