24 bool init(SDL_GPUDevice* dev,
const char* ttfPath);
37 std::string_view text,
48 void drawScreenText(glm::vec2 pixelPos, std::string_view text, glm::vec4 color,
float pixelHeight);
GPU-uploadable particle structs for all effect categories.
SDF glyph atlas loader and GPU texture manager.
Loads a TTF font, bakes an SDF glyph atlas, and uploads it to the GPU.
Definition SdfAtlas.hpp:18
Queues SDF glyph quads for world-space and screen-space text.
Definition SdfRenderer.hpp:18
void drawScreenText(glm::vec2 pixelPos, std::string_view text, glm::vec4 color, float pixelHeight)
Queue HUD text in pixel coordinates (no depth test).
Definition SdfRenderer.cpp:71
bool ready() const
Check whether the underlying atlas is ready for rendering.
Definition SdfRenderer.hpp:71
uint32_t worldCount() const
Get the number of queued world-space glyphs.
Definition SdfRenderer.hpp:59
const SdfGlyphGPU * hudData() const
Get a pointer to the HUD glyph data buffer.
Definition SdfRenderer.hpp:63
const SdfGlyphGPU * worldData() const
Get a pointer to the world-space glyph data buffer.
Definition SdfRenderer.hpp:55
uint32_t hudCount() const
Get the number of queued HUD glyphs.
Definition SdfRenderer.hpp:67
void quit()
Release all resources owned by this renderer.
Definition SdfRenderer.cpp:13
const SdfAtlas & atlas() const
Access the underlying SDF atlas (provides GPU texture binding).
Definition SdfRenderer.hpp:75
void drawWorldText(glm::vec3 worldPos, std::string_view text, glm::vec4 color, float worldHeight, glm::vec3 camRight, glm::vec3 camUp)
Queue world-space billboard text (faces camera, depth-tested).
Definition SdfRenderer.cpp:28
void clear()
Clear queues (called at start of each frame).
Definition SdfRenderer.cpp:21
std::vector< SdfGlyphGPU > worldGlyphs_
Definition SdfRenderer.hpp:79
std::vector< SdfGlyphGPU > hudGlyphs_
Definition SdfRenderer.hpp:80
bool init(SDL_GPUDevice *dev, const char *ttfPath)
Initialise the renderer by loading a font and baking the SDF atlas.
Definition SdfRenderer.cpp:7
SdfAtlas atlas_
Definition SdfRenderer.hpp:78
SDF glyph quad (world-space or screen-space HUD).
Definition ParticleTypes.hpp:94