-
Notifications
You must be signed in to change notification settings - Fork 0
/
LApp.h
105 lines (70 loc) · 1.67 KB
/
LApp.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#pragma once
//Using SDL, SDL_image, standard IO, and strings
#include <SDL.h>
#include <SDL_image.h>
#include <stdio.h>
#include <string>
#include "LTexture.h"
#include <vector>
#include "LButton.h"
#include <fstream>
#include "stageList.h"
#include "MainMenu.h"
#include "ToolPanel.h"
#ifndef __LAPP_H__
#define __LAPP_H__
//-----------------------------------------------------------//
class App {
private:
static App Instance;
bool Running = true;
bool inMenu = true;
bool loadflag = false;
bool nStageflag = false;
bool showcontrols = true;
SDL_Window* Window = NULL;
SDL_Renderer* Renderer = NULL;
SDL_Surface* PrimarySurface = NULL;
const int BUTTON_SPRITE_TOTAL = 5;
int TOTAL_BUTTONS = 1;
//SDL_Texture* xTexture = NULL;
static const int WindowWidth = 1840;
static const int WindowHeight = 800;
//Mouse button sprites
SDL_Rect bSpriteClips[5];
LTexture gButtonSpriteSheetTexture;
//text texture
SDL_Texture* textTexture = nullptr;
//vector of buttons
std::vector<LButton> vbuttons;
std::ofstream outfile;
stageList stageList;
TTF_Font *Font = NULL;
//main menu object pointer
MainMenu* menu = nullptr;
menuButton* controlBox = nullptr;
ToolPanel* rectpanel = nullptr;
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();
void saveToFile();
// Free up resources
void Cleanup();
// Load stage from button press
void loadRects();
public:
int Execute(int argc, char* argv[]);
//bool LoadMedia();
public:
static App* GetInstance();
static int GetWindowWidth();
static int GetWindowHeight();
};
#endif