-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window.h
46 lines (35 loc) · 852 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
#pragma once
#include "SDL.h"
#undef main
#include "Game.h"
#include <vector>
#define MIN_WINDOW_WIDTH 400
#define MIN_WINDOW_HEIGHT 400
//defines for the default background color fo the window.
#define BACKGROUND_RED 122
#define BACKGROUND_GREEN 122
#define BACKGROUND_BLUE 122
class Window
{
public:
void update(float deltaTime);
void handleEvents();
void clean();
void render();
bool running();
Window();
~Window();
void calculateInitialWindowDimensions();
void init(const char* title, int xpos, int ypos, bool fullscreen);
void handleKeyDown(SDL_KeyboardEvent& key);
void handleKeyUp(SDL_KeyboardEvent& key);
void resizeWindow(int windowWidth, int windowHeight);
static SDL_Renderer* renderer;
static int screenHeight;
static int screenWidth;
private:
bool isRunning;
SDL_Window* window;
bool frozen;
Game* game;
};