Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
GameModule.h
1#pragma once
2
3#include "Engine/Entity/Entity.h"
4#include "GLFW/glfw3.h"
5
6#include <filesystem>
7#include <functional>
8#include <memory>
9#include <vector>
10
11namespace Engine {
12
13 namespace Physics
14 {
16 }
17
18 namespace Entities
19 {
20 class Scene;
21 } // namespace Entities
22
27 {
28 const char * name = nullptr;
29 std::function<Entities::Scene *()> createScene;
30 };
31
35 class GameModule {
36 public:
40 GameModule() = default;
41
45 virtual ~GameModule() = default;
46
51 virtual void init(GLFWwindow* window);
52
57 virtual void initUI(GLFWwindow* window);
58
62 virtual void startup();
63
67 virtual void preTick();
68
73 virtual void tick(double deltaTime);
74
78 virtual void postTick();
79
83 virtual void preDraw();
84
89 virtual void onDraw(VkCommandBuffer commandBuffer);
90
94 virtual void postDraw();
95
99 virtual void shutdown();
100
106
110 [[nodiscard]] virtual std::vector<std::filesystem::path> getInitialSceneContents() const;
111
116 virtual void collectSceneBrowserEntries( std::vector<SceneBrowserEntry> & entries ) const;
117
121 GLFWwindow* getWindow() const;
122
127
128 private:
129 GLFWwindow* window;
130 };
131}
Owns scene entities, actor lifetime, and the scene graph root.
Definition Scene.h:84
GLFWwindow * getWindow() const
Returns the application window assigned during init().
virtual void collectSceneBrowserEntries(std::vector< SceneBrowserEntry > &entries) const
Appends scenes exposed to the scene browser.
virtual Entities::Scene * loadInitialScene()
Creates or returns the initial scene for this module.
virtual std::vector< std::filesystem::path > getInitialSceneContents() const
Returns asset paths to load into the initial scene.
virtual void registerCollisionProfiles(Physics::CollisionProfileRegistry &registry)
Registers module-specific collision profiles.
virtual void postDraw()
Runs logic after drawing.
virtual void initUI(GLFWwindow *window)
Initializes module UI state with the application window.
virtual void startup()
Runs module startup logic after initialization.
virtual void shutdown()
Shuts down module-owned resources.
GameModule()=default
Creates an empty game module.
virtual void preTick()
Runs logic before the game tick.
virtual void postTick()
Runs logic after the game tick.
virtual void preDraw()
Runs logic before drawing.
virtual void init(GLFWwindow *window)
Initializes module state with the application window.
virtual void tick(double deltaTime)
Runs per-frame game logic.
virtual ~GameModule()=default
Destroys the game module.
virtual void onDraw(VkCommandBuffer commandBuffer)
Records module draw commands.
GLFWwindow * window
Definition GameModule.h:129
Registers collision profile names, enum mappings, and pair responses.
Scene factory entry exposed to the scene browser.
Definition GameModule.h:27
std::function< Entities::Scene *()> createScene
Factory that creates the scene entry.
Definition GameModule.h:29
const char * name
Display name shown in the scene browser.
Definition GameModule.h:28