-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSystem.h
More file actions
75 lines (52 loc) · 1.7 KB
/
System.h
File metadata and controls
75 lines (52 loc) · 1.7 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
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once
#include "State.h"
class Input;
class Graphics;
/**The main system class that takes over after Main and manages the program.*/
class System
{
private:
/**Initialises varaibles to zero.*/
System();
/**Disabled copy constructor.*/
System(const System&);
public:
/**Creates an instance of the class in accordance with the singleton pattern.*/
static System* createInstance();
/**Does vital system setup.*/
bool initialise();
/**Shuts down the system at the end of execution.*/
void shutdown();
/**Runs the main loop, helping event management and then calling frame().*/
void run();
/**Signals that the program is to be quit. This does not happen immediately.*/
void exit();
/**Returns true if the system is initialised and ready to perform.*/
bool initialised();
/**Returns the main window handle.*/
HWND hwnd() { return m_hwnd; }
/**Returns the HINSTANCE of the program.*/
HINSTANCE windowInstance() { return m_hInstance; }
Vars::DisplaySettings displaySet;
Vars::CameraSettings cameraSet;
Input* input;
Graphics* graphics;
GameState gamestate;
private:
/**Serves as a frame to manage the majority of the game loop.*/
void frame();
/**Handles user input in accordance with game requirments.*/
void handleInput(Camera* camera);
/**Initialises the Window using the WINAPI.*/
void initialiseWindows();
/**Shuts down the Windows components that have been invoked through WINAPI.*/
void shutdownWindows();
LPCWSTR m_applicationName;
HINSTANCE m_hInstance;
HWND m_hwnd;
bool m_running;
bool m_initialised;
/**The WndProc callback called by the WINAPI.*/
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
};
extern System* systemptr;