SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
SUNENGINE.h
1#ifndef SUNENGINE_H
2#define SUNENGINE_H
3
4#include "AzulCore.h"
5
13class SUNENGINE : public Engine
14{
15 friend class SUNENGINEAttorney;
16private:
17 static SUNENGINE* ptrInstance;
18
19 SUNENGINE() = default;
20 SUNENGINE(const SUNENGINE&) = delete;
21 SUNENGINE& operator=(const SUNENGINE&) = delete;
22 ~SUNENGINE() = default;
23
24 static SUNENGINE& Instance()
25 {
26 if (ptrInstance == nullptr)
27 ptrInstance = new SUNENGINE();
28 return *ptrInstance;
29 };
30
34 virtual void Initialize();
35
39 virtual void LoadContent();
40
44 virtual void Update();
45
49 virtual void Draw();
50
54 virtual void UnLoadContent();
55
61 static float GetTime() { return Instance().GetTimeInSeconds(); }
62
66 static void RunSUNENGINE();
67
72
77
82
83public:
89 static int GetWindowWidth() { return Instance().getWidth(); }
90
96 static int GetWindowHeight() { return Instance().getHeight(); }
97};
98
99#endif
virtual void Draw()
Draws the content for the engine.
Definition SUNENGINE.cpp:66
static int GetWindowWidth()
Retrieves the width of the window.
Definition SUNENGINE.h:89
void SUNENGINEInitialize()
Method to be overloaded by users to initialize the engine. Happens after LoadResources.
static float GetTime()
Retrieves the current time in seconds.
Definition SUNENGINE.h:61
virtual void LoadContent()
Loads the content for the engine.
Definition SUNENGINE.cpp:41
virtual void Initialize()
Initializes the engine.
Definition SUNENGINE.cpp:31
void SUNENGINEEnd()
Method to be overloaded by users to end the engine. Happens first in UnLoadContent.
virtual void Update()
Updates the engine.
Definition SUNENGINE.cpp:53
static int GetWindowHeight()
Retrieves the height of the window.
Definition SUNENGINE.h:96
virtual void UnLoadContent()
Unloads the content for the engine.
Definition SUNENGINE.cpp:78
void LoadResources()
Method to be overloaded by users to load resources.
static void RunSUNENGINE()
Runs the SUNENGINE application.
Definition SUNENGINE.cpp:18