63 static void SetInstance(
EngineCore& engineCore);
66 bool isEditor =
false;
67 const char* applicationModuleName =
nullptr;
68 const char* applicationTitle =
nullptr;
69 const char* projectPath =
nullptr;
70 const char* engineBinaryPath =
nullptr;
81 virtual void InitializeScene(
bool shouldLoadSceneFromDefaults,
const char* scenePath =
nullptr);
82 virtual void ShowMainWindow();
86 virtual void RunEditorLoopIteration();
87 virtual void RunLoopIteration();
88 virtual void UpdateWindows();
104 virtual std::filesystem::path GetProjectPath()
const;
105 virtual std::filesystem::path GetBinaryPath()
const;
106 virtual std::filesystem::path GetEngineBinaryPath()
const;
107 virtual std::filesystem::path GetAssetsPath()
const;
108 virtual std::filesystem::path GetEngineAssetsPath()
const;
109 virtual std::filesystem::path GetAssetPath(std::string subPath)
const;
110 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 BaseRendererFactory* rendererFactory =
nullptr;
173 RenderPassRegistry* renderpassRegistry =
nullptr;
174 Events::Dispatcher* eventDispatcher =
nullptr;
175 Plugins::Interface* pluginInterface =
nullptr;
176 Plugins::IPluginManager* pluginManager =
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 engineBinaryPath;
184 std::filesystem::path engineAssetsPath;
185 std::filesystem::path assetsPath;
Definition WorldContextManager.hpp:12