Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::GameModule Class Reference

Base interface implemented by game-specific engine modules. More...

#include <GameModule.h>

Public Member Functions

 GameModule ()=default
 Creates an empty game module.
virtual ~GameModule ()=default
 Destroys the game module.
virtual void init (GLFWwindow *window)
 Initializes module state with the application window.
virtual void initUI (GLFWwindow *window)
 Initializes module UI state with the application window.
virtual void startup ()
 Runs module startup logic after initialization.
virtual void preTick ()
 Runs logic before the game tick.
virtual void tick (double deltaTime)
 Runs per-frame game logic.
virtual void postTick ()
 Runs logic after the game tick.
virtual void preDraw ()
 Runs logic before drawing.
virtual void onDraw (VkCommandBuffer commandBuffer)
 Records module draw commands.
virtual void postDraw ()
 Runs logic after drawing.
virtual void shutdown ()
 Shuts down module-owned resources.
virtual void registerCollisionProfiles (Physics::CollisionProfileRegistry &registry)
 Registers module-specific collision profiles.
virtual std::vector< std::filesystem::path > getInitialSceneContents () const
 Returns asset paths to load into the initial scene.
virtual void collectSceneBrowserEntries (std::vector< SceneBrowserEntry > &entries) const
 Appends scenes exposed to the scene browser.
GLFWwindow * getWindow () const
 Returns the application window assigned during init().
virtual Entities::Scene * loadInitialScene ()
 Creates or returns the initial scene for this module.

Private Attributes

GLFWwindow * window

Detailed Description

Base interface implemented by game-specific engine modules.

Definition at line 35 of file GameModule.h.

Constructor & Destructor Documentation

◆ GameModule()

Engine::GameModule::GameModule ( )
default

Creates an empty game module.

◆ ~GameModule()

virtual Engine::GameModule::~GameModule ( )
virtualdefault

Destroys the game module.

Member Function Documentation

◆ collectSceneBrowserEntries()

virtual void Engine::GameModule::collectSceneBrowserEntries ( std::vector< SceneBrowserEntry > & entries) const
virtual

Appends scenes exposed to the scene browser.

Parameters
entriesScene browser entry list to extend.

◆ getInitialSceneContents()

virtual std::vector< std::filesystem::path > Engine::GameModule::getInitialSceneContents ( ) const
nodiscardvirtual

Returns asset paths to load into the initial scene.

◆ getWindow()

GLFWwindow * Engine::GameModule::getWindow ( ) const

Returns the application window assigned during init().

◆ init()

virtual void Engine::GameModule::init ( GLFWwindow * window)
virtual

Initializes module state with the application window.

Parameters
windowGLFW window owned by the application.

References window.

◆ initUI()

virtual void Engine::GameModule::initUI ( GLFWwindow * window)
virtual

Initializes module UI state with the application window.

Parameters
windowGLFW window owned by the application.

References window.

◆ loadInitialScene()

virtual Entities::Scene * Engine::GameModule::loadInitialScene ( )
virtual

Creates or returns the initial scene for this module.

◆ onDraw()

virtual void Engine::GameModule::onDraw ( VkCommandBuffer commandBuffer)
virtual

Records module draw commands.

Parameters
commandBufferVulkan command buffer for the current frame.

◆ postDraw()

virtual void Engine::GameModule::postDraw ( )
virtual

Runs logic after drawing.

◆ postTick()

virtual void Engine::GameModule::postTick ( )
virtual

Runs logic after the game tick.

◆ preDraw()

virtual void Engine::GameModule::preDraw ( )
virtual

Runs logic before drawing.

◆ preTick()

virtual void Engine::GameModule::preTick ( )
virtual

Runs logic before the game tick.

◆ registerCollisionProfiles()

virtual void Engine::GameModule::registerCollisionProfiles ( Physics::CollisionProfileRegistry & registry)
virtual

Registers module-specific collision profiles.

Parameters
registryCollision profile registry to extend.

◆ shutdown()

virtual void Engine::GameModule::shutdown ( )
virtual

Shuts down module-owned resources.

◆ startup()

virtual void Engine::GameModule::startup ( )
virtual

Runs module startup logic after initialization.

◆ tick()

virtual void Engine::GameModule::tick ( double deltaTime)
virtual

Runs per-frame game logic.

Parameters
deltaTimeTime elapsed since the previous frame.

Member Data Documentation

◆ window

GLFWwindow* Engine::GameModule::window
private

Definition at line 129 of file GameModule.h.

Referenced by init(), and initUI().


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Game/GameModule.h