7#include "GameObjectMgr.h"
12#include "Render/RenderMgr.h"
15#include "../Sample/FirstDemoScene.h"
16#include "../Sample/WebDemoScene.h"
17#include "../Util/Loader/SCENE/SSceneLoader.h"
18#include "../Util/AssetsDef.h"
21#include "../Sample/WebDemoScene.h"
27constexpr short ENGINE_COUNT = 9;
29EngineCore::EngineCore() {
32EngineCore::~EngineCore() {
36void EngineCore::Init(
unsigned int width,
unsigned int height) {
39 for (
const auto& core : m_cores) {
43 m_oglMgr->ResizeWindow(width, height);
44 static_cast<RenderMgr*
>(m_renderMgr)->SetViewport();
56void EngineCore::Update(
float elapsedTime) {
57 for (
const auto& core : m_updateCores) {
58 core->Update(elapsedTime);
62void EngineCore::LateUpdate(
float elapsedTime) {
63 m_gameObjectMgr->DestroyQueuedObject();
66void EngineCore::Render()
const {
67 for (
const auto& core : m_renderCores) {
72void EngineCore::Exterminate() {
73 static_cast<MemoryMgr*
>(m_memoryMgr)->ExterminateObjects(
true);
74 for (
auto core : m_cores) {
80void EngineCore::GenerateCores() {
81 if(m_isGenerated)
return;
83 m_cores = std::vector<CoreBase*>();
84 m_cores.reserve(ENGINE_COUNT);
96 m_cores.push_back(m_resMgr);
97 m_cores.push_back(m_gameObjectMgr);
98 m_updateCores.push_back(m_gameObjectMgr);
100 m_cores.push_back(m_oglMgr);
101 m_renderCores.push_back(m_oglMgr);
102 m_cores.push_back(m_renderMgr);
103 m_renderCores.push_back(
dynamic_cast<RenderCoreBase* const
>(m_renderMgr));
104 m_cores.push_back(m_cameraMgr);
105 m_cores.push_back(m_lightMgr);
107 m_cores.push_back(m_sceneMgr);
108 m_updateCores.push_back(m_sceneMgr);
109 m_cores.push_back(m_memoryMgr);
111 m_cores.push_back(m_scriptMgr);
114void EngineCore::ResizeWindow(
unsigned int width,
unsigned int height) {
115 m_oglMgr->ResizeWindow(width, height);
116 static_cast<RenderMgr*
>(m_renderMgr)->SetViewport();
Class for managing rendering operations.