Skip to main content

bootstrap Namespace

Definition

namespace helios::engine::bootstrap { ... }

Classes Index

structComponentRegistrar<Tuple>
structComponentRegistrar<std::tuple< TEntityManagers... >>

Functions Index

voidregisterAllComponents ()

Registers all component types with the ComponentReflector. More...

std::pair< std::unique_ptr< GameWorld >, std::unique_ptr< GameLoop > >bootstrapGameWorld (const size_t capacity=ENTITY_MANAGER_DEFAULT_CAPACITY)

Creates a pre-configured GameWorld and GameLoop pair. More...

Functions

bootstrapGameWorld()

std::pair< std::unique_ptr< GameWorld >, std::unique_ptr< GameLoop > > helios::engine::bootstrap::bootstrapGameWorld (const size_t capacity=ENTITY_MANAGER_DEFAULT_CAPACITY)
inline

Creates a pre-configured GameWorld and GameLoop pair.

The factory heap-allocates both objects and performs the minimal setup required before application-specific configuration:

  • Calls registerAllComponents() via ComponentRegistrar
  • Registers WorldLifecycleManager, GameStateManager, MatchStateManager, and TimerManager
  • Tracks GameState and MatchState in the Session
  • Registers RenderCommandBuffer, EngineCommandBuffer, and StateCommandBuffer
  • Sets initial GameState to Booting

The caller receives ownership via unique_ptr and is responsible for registering Managers, configuring phases/passes, calling GameWorld::init() and GameLoop::init(), and driving the main loop.

Definition at line 148 of file bootstrap.ixx.

148 inline std::pair<std::unique_ptr<GameWorld>, std::unique_ptr<GameLoop>> bootstrapGameWorld(
150 ) {
151 auto gameWorld = std::make_unique<helios::engine::runtime::world::GameWorld>(capacity);
152
153 auto gameLoop = std::make_unique<helios::engine::runtime::gameloop::GameLoop>(*gameWorld);
154
155
157
158 // managers
160
163
164 gameWorld->registerManager<helios::engine::runtime::timing::TimerManager>();
165
166 gameWorld->session().trackState<helios::engine::runtime::enginestate::types::EngineState>();
167
168 gameWorld->registerCommandBuffer<RenderCommandBuffer>();
169 gameWorld->registerCommandBuffer<PlatformCommandBuffer>();
170 gameWorld->registerCommandBuffer<EngineCommandBuffer>();
171
172 gameWorld->session().setStateFrom<EngineState>(
174 EngineState::Undefined,
175 EngineState::Booting,
176 EngineStateTransitionId::BootRequest
177 ));
178
179
180 return std::make_pair(std::move(gameWorld), std::move(gameLoop));
181 }

References registerAllComponents, helios::registerComponents and helios::engine::runtime::enginestate::rules::DefaultEngineStateTransitionRules::rules.

registerAllComponents()

void helios::engine::bootstrap::registerAllComponents ()
inline

Registers all component types with the ComponentReflector.

This function must be called during engine initialization to enable runtime reflection features such as cloning, lifecycle callbacks (onAcquire, onRelease, onRemove), and enable/disable toggles.

Definition at line 85 of file bootstrap.ixx.

85 inline void registerAllComponents() {
86
87 static bool done = false;
88 if (done) {
89 return;
90 }
91 done = true;
92
94
95 }

Reference helios::registerComponents.

Referenced by bootstrapGameWorld.


The documentation for this namespace was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.