Skip to main content

TextRenderer.ixx File

Abstract base class for text rendering in the helios engine. More...

Included Headers

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespacetext

Text rendering abstractions and data types. More...

Classes Index

classTextRenderer

Abstract interface for text rendering implementations. More...

Description

Abstract base class for text rendering in the helios engine.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file TextRenderer.ixx
3 * @brief Abstract base class for text rendering in the helios engine.
4 */
5module;
6
7#include <string_view>
8
9export module helios.rendering.text.TextRenderer;
10
11import helios.rendering.text.TextRenderCommand;
12
13import helios.engine.modules.ui.widgets.types.FontId;
14
15import helios.rendering.shader.UniformValueMap;
16
17export namespace helios::rendering::text {
18
19 /**
20 * @brief Abstract interface for text rendering implementations.
21 *
22 * `TextRenderer` defines the contract for rendering text in the helios engine.
23 * Concrete implementations handle the specifics of text rendering for different
24 * graphics APIs (e.g., OpenGL, Vulkan).
25 *
26 * ## Responsibilities
27 *
28 * - **Font Management:** Load and cache font families for efficient glyph rendering.
29 * - **Text Rendering:** Process `TextRenderCommand` objects and render text to screen.
30 *
31 * ## Usage
32 *
33 * Implementations must override both pure virtual methods:
34 *
35 * ```cpp
36 * class MyTextRenderer : public TextRenderer {
37 * public:
38 * void addFontFamily(FontId fontId, std::string_view path,
39 * unsigned short begin, unsigned short end) override {
40 * // Load font and cache glyphs
41 * }
42 *
43 * void render(const TextRenderCommand& command,
44 * const UniformValueMap& frameUniformValues) noexcept override {
45 * // Render text based on command properties
46 * }
47 * };
48 * ```
49 *
50 * @see OpenGLGlyphTextRenderer
51 * @see TextRenderCommand
52 */
54 public:
55
56 /**
57 * @brief Virtual destructor for proper cleanup of derived classes.
58 */
59 virtual ~TextRenderer() = default;
60
61 /**
62 * @brief Renders text based on the given command.
63 *
64 * Processes a `TextRenderCommand` and renders the specified text using the
65 * associated shader and font. The implementation should apply both the
66 * command-specific uniform values and the frame-level uniform values.
67 *
68 * @param command The render command containing text, position, scale, and shader information.
69 * @param frameUniformValues Frame-level uniform values (e.g., projection matrix) to apply.
70 *
71 * @note This method is marked `noexcept` and must not throw exceptions.
72 */
73 virtual void render(
74 const TextRenderCommand& command,
75 const helios::rendering::shader::UniformValueMap& frameUniformValues
76 ) noexcept = 0;
77 };
78}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.