66 static void SetInstance(
EngineCore& engineCore);
69 bool isEditor =
false;
70 const char* applicationModuleName =
nullptr;
71 const char* applicationTitle =
nullptr;
72 const char* projectPath =
nullptr;
73 const char* engineBinaryPath =
nullptr;
84 virtual void InitializeScene(
bool shouldLoadSceneFromDefaults,
const char* scenePath =
nullptr);
85 virtual void ShowMainWindow();
89 virtual void RunEditorLoopIteration();
90 virtual void RunLoopIteration();
91 virtual void UpdateWindows();
105 virtual std::filesystem::path GetProjectPath()
const;
106 virtual std::filesystem::path GetBinaryPath()
const;
107 virtual std::filesystem::path GetEngineBasePath()
const;
108 virtual std::filesystem::path GetEngineBinaryPath()
const;
109 virtual entt::registry& GetEntityRegistry();
114 virtual void CalculateDeltaTime();
115 virtual double GetTimeSinceLaunch()
const;
116 virtual double GetDeltaTime()
const;
117 virtual void PushDeletion(std::function<
void()> fn);
118 virtual void ForceDeleteAllDeferred();
120 template<
typename T,
typename... Args>
121 void RegisterServiceEmplaced(Args&&... params) {
122 const size_t hash =
typeid(T).hash_code();
123 auto it = services.find(hash);
124 if (it == services.end()) {
125 services[hash] = Grindstone::Memory::AllocatorCore::Allocate<T>(std::forward<Args>(params)...);
130 void RegisterService(T* instance) {
131 const size_t hash =
typeid(T).hash_code();
132 auto it = services.find(hash);
133 if (it == services.end()) {
134 services.emplace(hash, instance);
139 void UnregisterService() {
140 const size_t hash =
typeid(T).hash_code();
141 auto it = services.find(hash);
142 if (it == services.end()) {
149 const size_t hash =
typeid(T).hash_code();
150 auto it = services.find(hash);
151 return (it != services.end())
152 ?
static_cast<T*
>(it->second)
156 DisplayManager* displayManager =
nullptr;
157 WindowManager* windowManager =
nullptr;
158 Assets::AssetManager* assetManager =
nullptr;
159 AssetRendererManager* assetRendererManager =
nullptr;
160 WorldContextManager* worldContextManager =
nullptr;
161 Profiler::Manager* profiler =
nullptr;
162 bool isEditor =
false;
164 Grindstone::DeferredDeletionQueue deferredDeletionQueue;
165 double currentTime = 0.0;
166 double deltaTime = 0.0;
167 std::chrono::steady_clock::time_point firstFrameTime;
168 std::chrono::steady_clock::time_point lastFrameTime;
169 SceneManagement::SceneManager* sceneManager =
nullptr;
170 ECS::ComponentRegistrar* componentRegistrar =
nullptr;
171 ECS::SystemRegistrar* systemRegistrar =
nullptr;
172 RenderPassRegistry* renderpassRegistry =
nullptr;
173 Events::Dispatcher* eventDispatcher =
nullptr;
174 Plugins::Interface* pluginInterface =
nullptr;
175 Plugins::IPluginManager* pluginManager =
nullptr;
176 Renderer::RenderingPipeline* renderingPipeline =
nullptr;
177 GraphicsAPI::Core* graphicsCore =
nullptr;
178 Input::Interface* inputManager =
nullptr;
179 std::unordered_map<std::size_t, void*> services;
180 bool shouldClose =
false;
181 std::filesystem::path projectPath;
182 std::filesystem::path binaryPath;
183 std::filesystem::path engineBasePath;
184 std::filesystem::path engineBinaryPath;
Definition WorldContextManager.hpp:12