-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathApp.h
More file actions
63 lines (44 loc) · 1.02 KB
/
App.h
File metadata and controls
63 lines (44 loc) · 1.02 KB
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
//==============================================================================
/*
Primary application class
3/11/2014
SDLTutorials.com
Tim Jones
*/
//==============================================================================
#ifndef __APP_H__
#define __APP_H__
#include <SDL2/SDL.h>
#include "TextureBank.h"
class App {
private:
static App Instance;
bool Running = true;
SDL_Window* Window = NULL;
SDL_Renderer* Renderer = NULL;
SDL_Surface* PrimarySurface = NULL;
static const int WindowWidth = 1024;
static const int WindowHeight = 768;
Texture* TestTexture;
private:
App();
// Capture SDL Events
void OnEvent(SDL_Event* Event);
// Initialize our SDL game / app
bool Init();
// Logic loop
void Loop();
// Render loop (draw)
void Render();
// Free up resources
void Cleanup();
public:
int Execute(int argc, char* argv[]);
public:
SDL_Renderer* GetRenderer();
public:
static App* GetInstance();
static int GetWindowWidth();
static int GetWindowHeight();
};
#endif