Skip to main content

TextRenderCommand.ixx File

Low-level render command for text rendering. More...

Included Headers

#include <memory> #include <string_view> #include <cassert> #include <string> #include <helios.engine.modules.ui.widgets.types.FontId> #include <helios.rendering.text.TextMesh> #include <helios.rendering.text.TextRenderPrototype> #include <helios.rendering.shader.UniformValueMap>

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespacetext

Text rendering abstractions and data types. More...

Classes Index

classTextRenderCommand

Immutable command object for rendering a single piece of text. More...

Description

Low-level render command for text rendering.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file TextRenderCommand.ixx
3 * @brief Low-level render command for text rendering.
4 */
5module;
6
7#include <memory>
8#include <string_view>
9#include <cassert>
10#include <string>
11
12export module helios.rendering.text.TextRenderCommand;
13
14
15import helios.rendering.shader.UniformValueMap;
16import helios.rendering.text.TextRenderPrototype;
17import helios.rendering.text.TextMesh;
18
19import helios.engine.modules.ui.widgets.types.FontId;
20
21export namespace helios::rendering::text {
22
23 /**
24 * @brief Immutable command object for rendering a single piece of text.
25 *
26 * `TextRenderCommand` is a low-level, move-only object that encapsulates all
27 * data needed to render text in a single frame. It is created from a
28 * `TextRenderable` and consumed by the `TextRenderer`.
29 *
30 * ## Design
31 *
32 * - **Immutable:** Once created, the command cannot be modified.
33 * - **Move-only:** Copy operations are deleted to prevent accidental duplication.
34 * - **Self-contained:** Contains all uniform values needed for rendering.
35 *
36 * ## Data Flow
37 *
38 * ```
39 * TextRenderable → TextRenderCommand → RenderQueue → TextRenderer
40 * ```
41 *
42 * @see TextRenderable
43 * @see TextRenderer
44 * @see TextMesh
45 */
47
48 /**
49 * @brief Non-owning pointer to the render prototype.
50 *
51 * The prototype must remain valid for the lifetime of this command.
52 */
53 const helios::rendering::text::TextRenderPrototype* textRenderPrototype_;
54
55 /**
56 * @brief Uniform values specific to this text instance.
57 */
59
60 /**
61 * @brief Material/text-specific uniform values (e.g., color).
62 */
64
65 /**
66 * @brief Non-owning pointer to the text mesh containing vertex data.
67 *
68 * The text mesh must remain valid for the lifetime of this command.
69 */
71
72
73 public:
74
75 /**
76 * @brief Deleted copy constructor.
77 *
78 * TextRenderCommand is move-only to prevent accidental duplication.
79 */
81
82 /**
83 * @brief Deleted copy assignment operator.
84 *
85 * TextRenderCommand is move-only to prevent accidental duplication.
86 */
88
89 /**
90 * @brief Move constructor.
91 */
92 TextRenderCommand(TextRenderCommand&&) noexcept = default;
93
94 /**
95 * @brief Move assignment operator.
96 */
97 TextRenderCommand& operator=(TextRenderCommand&&) noexcept = default;
98
99 /**
100 * @brief Default destructor.
101 */
102 ~TextRenderCommand() = default;
103
104 /**
105 * @brief Constructs a text render command.
106 *
107 * @param text The text string to render.
108 * @param textRenderPrototype Non-owning pointer to the prototype (must outlive this command).
109 * @param drawProperties Position, scale, and font selection.
110 * @param textUniformValues Uniform values for the text shader.
111 *
112 * @pre `textRenderPrototype` must not be null.
113 */
119 ) noexcept :
120 textMesh_(textMesh),
121 textRenderPrototype_(textRenderPrototype),
122 objectUniformValues_(objectUniformValues),
123 materialUniformValues_(materialUniformValues) {
124
125 assert(textRenderPrototype_ && "TextRenderPrototype must not be null");
126
127 }
128
129 /**
130 * @brief Returns the render prototype.
131 *
132 * @return Non-owning pointer to the prototype.
133 */
135 return textRenderPrototype_;
136 }
137
138 /**
139 * @brief Returns the text mesh containing vertex data.
140 *
141 * The mesh provides access to the pre-computed glyph vertices for rendering.
142 *
143 * @return Non-owning pointer to the text mesh.
144 */
145 [[nodiscard]] const helios::rendering::text::TextMesh* textMesh() const noexcept {
146 return textMesh_;
147 }
148
149 /**
150 * @brief Returns the text-specific uniform values.
151 *
152 * @return Reference to the uniform value map.
153 */
155 return objectUniformValues_;
156 }
157
158 /**
159 * @brief Returns the material-specific uniform values.
160 *
161 * Contains values such as text color and other material properties.
162 *
163 * @return Reference to the material uniform value map.
164 */
166 return materialUniformValues_;
167 }
168 };
169
170
171}
172

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.