Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
Engine::Application Class Reference

Encapsulates the core engine lifecycle, main render loop, window, Vulkan renderer, and systems. More...

#include <Application.hpp>

Public Member Functions

 Application (const ApplicationConfig &config=ApplicationConfig())
 Construct a new Application.
virtual ~Application ()
 Destroy the Application and release Vulkan/window resources.
void run ()
 Boots and runs the main loop of the application.
void quit ()
 Stops the application execution.
template<typename T>
void registerComponent (const std::string &componentName)
 Templated method to register game-specific components to the serialization registry.
virtual void onStart ()
 Called upon initialization. Override to register custom components and load startup scenes.
virtual void onUpdate (float dt)
 Called each frame for custom update logic.
virtual void onShutdown ()
 Called during application shutdown.
EditorModeState & getEditorMode ()
 Gets the current EditorModeState (e.g. isPlaying, flyMode).

Protected Member Functions

VulkanRenderer & getRenderer ()
 Gets reference to the active VulkanRenderer.

Protected Attributes

Registry registry
 Registry instance for ECS entity-component database.
SceneManager sceneManager
 Scene Manager coordinates scene changes and loading.
SystemManager systemManager
 System Manager driving sequential system update loops.

Private Member Functions

void initEngine ()
void cleanupEngine ()
void loadConfig ()
int buildGame (const std::string &projectPath, const std::string &outPath)

Private Attributes

GLFWwindow * window = nullptr
 Native window handle.
std::unique_ptr< VulkanRenderer > renderer
 Reference to VulkanRenderer.
std::unique_ptr< EditorUI > editorUI
 Editor graphical interface overlay.
EditorModeState editorMode
 Shared editor toggle and navigation states.
std::shared_ptr< RenderSystem > renderSystem
 Reference to default rendering system.
std::shared_ptr< UISystem > uiSystem
 Reference to UI system.
std::unique_ptr< PluginManager > pluginManager
 Pointer to the dynamic plugin manager.
ApplicationConfig config
 Active application config values.
bool running = false
 Running status flag.

Detailed Description

Encapsulates the core engine lifecycle, main render loop, window, Vulkan renderer, and systems.

Constructor & Destructor Documentation

◆ Application()

Engine::Application::Application ( const ApplicationConfig & config = ApplicationConfig())

Construct a new Application.

Parameters
configThe application start configuration.

◆ ~Application()

Engine::Application::~Application ( )
virtual

Destroy the Application and release Vulkan/window resources.

Member Function Documentation

◆ buildGame()

int Engine::Application::buildGame ( const std::string & projectPath,
const std::string & outPath )
private

◆ cleanupEngine()

void Engine::Application::cleanupEngine ( )
private

◆ getEditorMode()

EditorModeState & Engine::Application::getEditorMode ( )
inline

Gets the current EditorModeState (e.g. isPlaying, flyMode).

◆ getRenderer()

VulkanRenderer & Engine::Application::getRenderer ( )
inlineprotected

Gets reference to the active VulkanRenderer.

Returns
VulkanRenderer& reference.

◆ initEngine()

void Engine::Application::initEngine ( )
private

◆ loadConfig()

void Engine::Application::loadConfig ( )
private

◆ onShutdown()

virtual void Engine::Application::onShutdown ( )
inlinevirtual

Called during application shutdown.

◆ onStart()

virtual void Engine::Application::onStart ( )
inlinevirtual

Called upon initialization. Override to register custom components and load startup scenes.

◆ onUpdate()

virtual void Engine::Application::onUpdate ( float dt)
inlinevirtual

Called each frame for custom update logic.

Parameters
dtDelta time in seconds.

◆ quit()

void Engine::Application::quit ( )

Stops the application execution.

◆ registerComponent()

template<typename T>
void Engine::Application::registerComponent ( const std::string & componentName)
inline

Templated method to register game-specific components to the serialization registry.

Template Parameters
TComponent structure/class type.
Parameters
componentNameKey name string in JSON files.

◆ run()

void Engine::Application::run ( )

Boots and runs the main loop of the application.

Member Data Documentation

◆ config

ApplicationConfig Engine::Application::config
private

Active application config values.

◆ editorMode

EditorModeState Engine::Application::editorMode
private

Shared editor toggle and navigation states.

◆ editorUI

std::unique_ptr<EditorUI> Engine::Application::editorUI
private

Editor graphical interface overlay.

◆ pluginManager

std::unique_ptr<PluginManager> Engine::Application::pluginManager
private

Pointer to the dynamic plugin manager.

◆ registry

Registry Engine::Application::registry
protected

Registry instance for ECS entity-component database.

◆ renderer

std::unique_ptr<VulkanRenderer> Engine::Application::renderer
private

Reference to VulkanRenderer.

◆ renderSystem

std::shared_ptr<RenderSystem> Engine::Application::renderSystem
private

Reference to default rendering system.

◆ running

bool Engine::Application::running = false
private

Running status flag.

◆ sceneManager

SceneManager Engine::Application::sceneManager
protected

Scene Manager coordinates scene changes and loading.

◆ systemManager

SystemManager Engine::Application::systemManager
protected

System Manager driving sequential system update loops.

◆ uiSystem

std::shared_ptr<UISystem> Engine::Application::uiSystem
private

Reference to UI system.

◆ window

GLFWwindow* Engine::Application::window = nullptr
private

Native window handle.


The documentation for this class was generated from the following files: