Root application class; owns shared resources and manages screen transitions.
More...
#include <App.hpp>
|
| bool | init () |
| | Initialize SDL, the GPU renderer, ImGui, and the network client.
|
| SDL_AppResult | event (SDL_Event *event) |
| | Forward an SDL event to the active screen.
|
| SDL_AppResult | iterate () |
| | Tick the active screen and check for pending screen transitions.
|
| void | quit () |
| | Shut down all subsystems and release resources.
|
| void | transitionTo (Screen next) |
| | Destroy the current screen and activate the requested one.
|
|
| void | cleanup () |
| | Destroy all subsystems without asserting on partial-init state.
|
Root application class; owns shared resources and manages screen transitions.
Implements the SDL3 app-callback contract (init/event/iterate/quit). Exactly one IScreen is active at a time; App drives transitions between Lobby and InGame.
◆ Screen
Named screens the application can display.
| Enumerator |
|---|
| Home | Main menu screen.
|
| Lobby | Pre-match lobby waiting room.
|
| InGame | Active match session.
|
◆ cleanup()
Destroy all subsystems without asserting on partial-init state.
◆ event()
| SDL_AppResult App::event |
( |
SDL_Event * | event | ) |
|
Forward an SDL event to the active screen.
- Returns
- SDL_APP_CONTINUE or SDL_APP_FAILURE.
◆ init()
Initialize SDL, the GPU renderer, ImGui, and the network client.
- Returns
- True on success; false if any subsystem fails to initialize.
◆ iterate()
| SDL_AppResult App::iterate |
( |
| ) |
|
Tick the active screen and check for pending screen transitions.
- Returns
- SDL_APP_CONTINUE or SDL_APP_FAILURE.
◆ quit()
Shut down all subsystems and release resources.
◆ transitionTo()
| void App::transitionTo |
( |
Screen | next | ) |
|
Destroy the current screen and activate the requested one.
- Parameters
-
| next | The screen to transition to. |
◆ client
Network client connected to the authoritative server.
◆ current
Which screen is currently active.
◆ developerConfig
Developer toggles loaded from config.toml.
◆ imguiContextOwned
| bool App::imguiContextOwned = false |
|
private |
True once App has created the ImGui context.
◆ networkConfig
Host/port/transport loaded from config.toml.
◆ renderer
SDL_GPU PBR renderer, shared across screens.
◆ screen_
| std::unique_ptr<IScreen> App::screen_ |
|
private |
◆ window
| SDL_Window* App::window = nullptr |
|
private |
The documentation for this class was generated from the following files: