CSEngine
Loading...
Searching...
No Matches
EngineCoreInstance.h
1#pragma once
2
3#include <vector>
4#include <list>
5#include "../MacroDef.h"
6#include "Base/RenderCoreBase.h"
7
8#define GET_CORE_FUNCTION(CORENAME, core_instance) \
9CORENAME* Get##CORENAME##Core() const { \
10 return static_cast<CORENAME*>(core_instance); \
11}
12
13#define GetCore(CORENAME) Get##CORENAME##Core()
14
15// Core Class Predeclaration
16namespace CSE {
17 class ResMgr;
18 class GameObjectMgr;
19 class RenderMgr;
20 class CameraMgr;
21 class LightMgr;
22 class SceneMgr;
23 class MemoryMgr;
24 class ScriptMgr;
25 class OGLMgr;
26 class ReflectionMgr;
27 class CoreBase;
28}
29
30namespace CSE {
32 protected:
34 virtual ~EngineCoreInstance();
35
36 public:
37 GET_CORE_FUNCTION(ResMgr, m_resMgr);
38 GET_CORE_FUNCTION(GameObjectMgr, m_gameObjectMgr);
39 GET_CORE_FUNCTION(RenderMgr, m_renderMgr);
40 GET_CORE_FUNCTION(CameraMgr, m_cameraMgr);
41 GET_CORE_FUNCTION(LightMgr, m_lightMgr);
42 GET_CORE_FUNCTION(SceneMgr, m_sceneMgr);
43 GET_CORE_FUNCTION(MemoryMgr, m_memoryMgr);
44 GET_CORE_FUNCTION(ScriptMgr, m_scriptMgr);
45 GET_CORE_FUNCTION(ReflectionMgr, m_reflectionMgr);
46
47 void Init(unsigned int width, unsigned int height);
48 void Update(float elapsedTime);
49 void LateUpdate(float elapsedTime);
50 void Render() const;
51 void Exterminate();
52 void ExterminateWithoutReflectionDefine();
53 void ResizeWindow(unsigned int width, unsigned int height);
54 void SetDeviceBuffer(unsigned int id);
55 virtual void GenerateCores();
56
57 bool IsReady() const {
58 return m_isReady;
59 }
60
61 protected:
62 std::vector<CoreBase*> m_cores;
63 std::list<RenderCoreBase*> m_renderCores;
64 std::list<CoreBase*> m_updateCores;
65
66 //For Reference
67 ResMgr* m_resMgr = nullptr;
68 GameObjectMgr* m_gameObjectMgr = nullptr;
69 RenderMgr* m_renderMgr = nullptr;
70 CameraMgr* m_cameraMgr = nullptr;
71 LightMgr* m_lightMgr = nullptr;
72 SceneMgr* m_sceneMgr = nullptr;
73 MemoryMgr* m_memoryMgr = nullptr;
74 ScriptMgr* m_scriptMgr = nullptr;
75 ReflectionMgr* m_reflectionMgr = nullptr;
76
77 OGLMgr* m_oglMgr = nullptr;
78
79 bool m_isGenerated = false;
80 bool m_isReady = false;
81 };
82}
Class for managing rendering operations.
Definition RenderMgr.h:24