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 146 of file bootstrap.ixx.

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

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 83 of file bootstrap.ixx.

83 inline void registerAllComponents() {
84
85 static bool done = false;
86 if (done) {
87 return;
88 }
89 done = true;
90
92
93 }

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.