-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGWindow.h
54 lines (38 loc) · 1.05 KB
/
GWindow.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
#pragma once
#ifndef WINDOW_H
#define WINDOW_H
#include "includes.h"
class GFrame;
struct GStylesheet;
class GElement;
class GWindow {
protected:
bool active;
SDL_Renderer* renderer;
SDL_Window* window;
SDL_Event event;
SDL_Rect test_rect;
double render_timeout;
GStylesheet* stylesheet;
GFrame* active_layer;
std::list<GFrame*> layers;
std::unordered_map<std::string, GElement*> id_map;
virtual void Start();
virtual void AdditionalStartRoutine();
virtual void AdditionalLoopRoutine();
virtual void AdditionalExitRoutine();
public:
GWindow(SDL_Renderer* renderer, SDL_Window* window);
GWindow(std::string title, bool centered_x, bool centered_y, int w, int h, Uint32 flags);
void AddLayer(GFrame* layer);
void AttachStylesheet(GStylesheet * stylesheet);
void SetActiveLayer(GFrame* layer);
GFrame* GetActiveLayer();
GElement* GetElementByID(std::string ID);
bool GetState();
void SetState(bool state);
SDL_Window* GetWindow();
SDL_Renderer* GetRenderer();
~GWindow();
};
#endif`