|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings. *UICanvas acts as the graphics compositor for the UI layer. It intercepts layout draw commands, pools transient vertex lists into unified buffers to optimize pipeline state swaps, and coordinates a sliding frame cache system that automatically tracks and flushes unreferenced font textures from VRAM. More...
#include <flint/ui/ui-canvas.h>
Collaboration diagram for Flint::UICanvas:Public Member Functions | |
| FLINT_API | UICanvas (GPURenderer &renderer) |
| Binds the UI renderer subsystem to the master application graphics context layout tree. | |
| UICanvas (const UICanvas &)=delete | |
| UICanvas & | operator= (const UICanvas &)=delete |
| FLINT_API void | emit (RenderQueue &queue) |
| FLINT_API void | uploadGeometry (SDL_GPUCommandBuffer *cmd) |
| Pass 1 of the render loop: Synchronizes local vertex lists down to the physical GPU VRAM. | |
| FLINT_API void | flushDrawCalls (SDL_GPURenderPass *renderPass, SDL_GPUCommandBuffer *commandBuffer) |
| Pass 2 of the render loop: Binds graphics pipelines and triggers draw execution commands. | |
| FLINT_API void | setScreenSize (Vec2f size) |
| Syncs internal display bounding metrics to transform absolute screen pixel bounds cleanly. | |
| FLINT_API void | drawRect (Rect< float > rect, Color color) |
| Submits a flat quad drawing sequence down to the current active runtime pipeline layer. | |
| FLINT_API void | drawText (std::string text, float x, float y, float fontSize, Color color, std::string fontName="", uint16_t weight=400) |
| Enqueues a string draw command record to be processed during the geometry generation pass. | |
| FLINT_API void | drawTexture (const GPUTexture &texture, Rect< float > rect, Color tint={255, 255, 255, 255}) |
| Appends a geometric quad textured draw record down to the dynamic vertex batch structure arrays. | |
| Vec2f | getScreenSize () const |
| Returns the active window coordinates representing the screen boundaries. | |
| FLINT_API Vec2f | measureText (const std::string &text, float fontSize, const std::string &fontName="", uint16_t weight=400) |
| Calculates structural spatial dimensions a text block requires before executing layout renders. | |
| FLINT_API float | getGlyphCenterOffset (const std::string &text, float fontSize, const std::string &fontName="", uint16_t weight=400) |
| FLINT_API bool | loadFont (std::vector< char > &&data, const std::string &fontName, uint16_t weight=400) |
| Registers raw binary TTF font file data into the subsystem memory allocator. | |
| void | setDefaultFont (const std::string &name) |
| Assigns the base default fallback typography name token. | |
| FLINT_API void | discardDrawCalls () |
| Instantly clears local staging arrays, abandoning all un-flushed vector and character draw steps. | |
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings. *UICanvas acts as the graphics compositor for the UI layer. It intercepts layout draw commands, pools transient vertex lists into unified buffers to optimize pipeline state swaps, and coordinates a sliding frame cache system that automatically tracks and flushes unreferenced font textures from VRAM.
Definition at line 107 of file ui-canvas.h.
Submits a flat quad drawing sequence down to the current active runtime pipeline layer.
| rect | Calculated screen space dimension coordinate box tracking the destination boundary. |
| color | The target uniform tint vector applied to the shape primitive. |
| FLINT_API void Flint::UICanvas::drawText | ( | std::string | text, |
| float | x, | ||
| float | y, | ||
| float | fontSize, | ||
| Color | color, | ||
| std::string | fontName = "", | ||
| uint16_t | weight = 400 ) |
Enqueues a string draw command record to be processed during the geometry generation pass.
| FLINT_API void Flint::UICanvas::drawTexture | ( | const GPUTexture & | texture, |
| Rect< float > | rect, | ||
| Color | tint = {255, 255, 255, 255} ) |
Appends a geometric quad textured draw record down to the dynamic vertex batch structure arrays.
| texture | Reference mapping straight to the target asset allocation buffer container. |
| rect | Final spatial destination pixel bounds on the display grid canvas. |
| tint | Global multiplicative color modifier channel adjustments. |
| FLINT_API void Flint::UICanvas::flushDrawCalls | ( | SDL_GPURenderPass * | renderPass, |
| SDL_GPUCommandBuffer * | commandBuffer ) |
Pass 2 of the render loop: Binds graphics pipelines and triggers draw execution commands.
|
inline |
Returns the active window coordinates representing the screen boundaries.
Definition at line 169 of file ui-canvas.h.
| FLINT_API bool Flint::UICanvas::loadFont | ( | std::vector< char > && | data, |
| const std::string & | fontName, | ||
| uint16_t | weight = 400 ) |
Registers raw binary TTF font file data into the subsystem memory allocator.
| data | Binary stream buffer moving the contents of the file. |
| fontName | Explicit identification key assigned to track this family grouping. |
| weight | Specific fallback prioritization code mapped to identify the variant typeface weight. |
| FLINT_API Vec2f Flint::UICanvas::measureText | ( | const std::string & | text, |
| float | fontSize, | ||
| const std::string & | fontName = "", | ||
| uint16_t | weight = 400 ) |
Calculates structural spatial dimensions a text block requires before executing layout renders.
|
inline |
Assigns the base default fallback typography name token.
Definition at line 197 of file ui-canvas.h.
| FLINT_API void Flint::UICanvas::uploadGeometry | ( | SDL_GPUCommandBuffer * | cmd | ) |
Pass 1 of the render loop: Synchronizes local vertex lists down to the physical GPU VRAM.