28 bool init(SDL_GPUDevice* device,
29 SDL_GPUShaderFormat shaderFormat,
38 void resize(uint32_t newW, uint32_t newH);
53 [[nodiscard]] std::vector<std::unique_ptr<HudWidget>>&
widgets() {
return widgets_; }
75 std::vector<std::unique_ptr<HudWidget>>
widgets_;
Immediate-mode draw API for HUD widgets.
GPU backend for the HUD system — owns offscreen target, pipeline, and vertex buffer upload.
Runtime GPU atlas for LunaSVG-rasterized HUD SVG assets.
Lightweight fixed-pool tween engine for HUD animations.
Shared types for the HUD system.
Accumulates HUD geometry during a frame for batch rendering.
Definition HudContext.hpp:19
Renders batched HUD geometry to an offscreen RGBA8 texture.
Definition HudRenderer.hpp:23
Definition HudSvgAtlas.hpp:26
Fixed-size tween pool. No heap allocations.
Definition HudTween.hpp:35
Top-level HUD system.
Definition Hud.hpp:25
void resize(uint32_t newW, uint32_t newH)
Notify of window resize.
Definition Hud.cpp:68
float debugAlignmentBorderOffsetY_
Definition Hud.hpp:79
float debugAlignmentBorderOffsetX_
Definition Hud.hpp:78
SDL_GPUTexture * getOutputTexture() const
The offscreen texture to blit.
Definition Hud.hpp:50
void quit()
Release all resources.
Definition Hud.cpp:61
void update(float dt, const HudGameState &state)
Tick widget animations and consume game events.
Definition Hud.cpp:89
void resolveAnchor(const HudWidget &w, float &outX, float &outY) const
Resolve anchor + offset to pixel coordinates.
Definition Hud.cpp:152
HudRenderer renderer_
Definition Hud.hpp:71
std::vector< std::unique_ptr< HudWidget > > widgets_
Definition Hud.hpp:75
void render()
Draw all widgets and flush to the GPU offscreen target.
Definition Hud.cpp:101
void createWidgets()
Create all default widgets with initial layout.
Definition Hud.cpp:199
bool & debugShowAlignmentBorder()
Debug overlay: draw a screen-space alignment border.
Definition Hud.hpp:62
void processEvent(const SDL_Event *event, const InputBindings *bindings)
Forward an SDL event to interactive widgets (buy menu, scoreboard).
Definition Hud.cpp:75
bool debugRenderInactiveWidgets_
Definition Hud.hpp:76
bool debugShowAlignmentBorder_
Definition Hud.hpp:77
float screenH_
Definition Hud.hpp:81
float screenW_
Definition Hud.hpp:81
HudTweenPool & tweens()
Access the tween pool (for debug panel).
Definition Hud.hpp:56
HudSvgAtlas svgAtlas_
Definition Hud.hpp:72
HudContext context_
Definition Hud.hpp:73
float & debugAlignmentBorderOffsetY()
Vertical inset for the alignment border from top and bottom edges.
Definition Hud.hpp:68
bool init(SDL_GPUDevice *device, SDL_GPUShaderFormat shaderFormat, const SdfAtlas &sdfAtlas, uint32_t screenW, uint32_t screenH)
Initialise all HUD subsystems and create default widgets.
Definition Hud.cpp:39
HudTweenPool tweens_
Definition Hud.hpp:74
float & debugAlignmentBorderOffsetX()
Horizontal inset for the alignment border from left and right edges.
Definition Hud.hpp:65
std::vector< std::unique_ptr< HudWidget > > & widgets()
Access all widgets (for debug panel iteration).
Definition Hud.hpp:53
bool & debugRenderInactiveWidgets()
Debug override: render inactive widgets, excluding the railgun scope.
Definition Hud.hpp:59
Loads a TTF font, bakes an SDF glyph atlas, and uploads it to the GPU.
Definition SdfAtlas.hpp:18
Snapshot of game state consumed by the HUD each frame.
Definition HudTypes.hpp:367