TextRenderable.ixx File
High-level text component for scene integration. More...
Included Headers
#include <memory>
#include <optional>
#include <stdexcept>
#include <utility>
#include <helios.rendering.text.TextMesh>
#include <helios.rendering.text.TextShaderPropertiesOverride>
#include <helios.rendering.text.TextRenderPrototype>
#include <helios.rendering.RenderQueue>
#include <helios.rendering.shader.UniformValueMap>
#include <helios.rendering.text.TextRenderCommand>
#include <helios.rendering.Renderable>
Namespaces Index
| namespace | helios |
| namespace | rendering |
|
Graphics rendering infrastructure. More... | |
| namespace | text |
|
Text rendering abstractions and data types. More... | |
Classes Index
| class | TextRenderable |
|
High-level text component that can be attached to game objects. More... | |
Description
High-level text component for scene integration.
File Listing
The file content with the documentation metadata removed is:
27export namespace helios::rendering::text {
57 class TextRenderable final : public helios::rendering::Renderable {
64 std::shared_ptr<const helios::rendering::text::TextRenderPrototype> textRenderPrototype_ = nullptr;
70 std::optional<helios::rendering::text::TextShaderPropertiesOverride> textShaderPropertiesOverride_;
83 * @param textMesh Unique pointer to the text mesh containing text content, font, and layout data.
85 * @param textShaderPropertiesOverride Optional overrides for shader properties (e.g., text color).
89 explicit TextRenderable(
90 std::unique_ptr<helios::rendering::text::TextMesh> textMesh,
92 const std::optional<helios::rendering::text::TextShaderPropertiesOverride>& textShaderPropertiesOverride = std::nullopt
94 textRenderPrototype_(std::move(renderPrototype)),
99 if (!textRenderPrototype_) {
110 [[nodiscard]] std::optional<helios::rendering::text::TextShaderPropertiesOverride> textShaderPropertiesOverride() noexcept {
111 return textShaderPropertiesOverride_;
119 void setTextShaderPropertiesOverride(helios::rendering::text::TextShaderPropertiesOverride textShaderPropertiesOverride) noexcept {
130 [[nodiscard]] const helios::math::aabbf& localAABB() const noexcept override {
131 return textMesh_->localAABB(textRenderPrototype_->fontResourceProvider());
149 return textMesh_->text();
162 [[nodiscard]] std::shared_ptr<const helios::rendering::text::TextRenderPrototype> shareTextRenderPrototype() const noexcept {
163 return textRenderPrototype_;
174 [[nodiscard]] const helios::rendering::text::TextRenderPrototype& textRenderPrototype() const noexcept {
175 return *textRenderPrototype_;
185 [[nodiscard]] const helios::rendering::text::TextMesh& textMesh() const noexcept {
186 return *textMesh_;
194 [[nodiscard]] helios::rendering::text::TextMesh& textMesh() noexcept {
195 return *textMesh_;
206 void writeUniformValues(helios::rendering::shader::UniformValueMap& uniformValueMap) const noexcept override {
207 textRenderPrototype_->textProperties().writeUniformValues(uniformValueMap);
209 if (textShaderPropertiesOverride_) {
210 textShaderPropertiesOverride_->writeUniformValues(uniformValueMap);
225 helios::rendering::RenderQueue& renderQueue,
226 helios::rendering::shader::UniformValueMap& objectUniformValues,
227 helios::rendering::shader::UniformValueMap& materialUniformValues) const override {
230 writeUniformValues(materialUniformValues);
232 renderQueue.add(helios::rendering::text::TextRenderCommand(
233 textMesh_.get(),
234 textRenderPrototype_.get(),
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.