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> textPropertiesOverride_;
83 * @param textMesh Unique pointer to the text mesh containing text content, font, and layout data.
89 explicit TextRenderable(
90 std::unique_ptr<helios::rendering::text::TextMesh> textMesh,
92 const std::optional<helios::rendering::text::TextShaderPropertiesOverride>& textPropertiesOverride = std::nullopt
94 textRenderPrototype_(std::move(renderPrototype)),
96 textPropertiesOverride_(textPropertiesOverride)
99 if (!textRenderPrototype_) {
112 [[nodiscard]] const helios::math::aabbf& localAABB() const noexcept override {
113 return textMesh_->localAABB(textRenderPrototype_->fontResourceProvider());
131 return textMesh_->text();
144 [[nodiscard]] std::shared_ptr<const helios::rendering::text::TextRenderPrototype> shareTextRenderPrototype() const noexcept {
145 return textRenderPrototype_;
156 [[nodiscard]] const helios::rendering::text::TextRenderPrototype& textRenderPrototype() const noexcept {
157 return *textRenderPrototype_;
167 [[nodiscard]] const helios::rendering::text::TextMesh& textMesh() const noexcept {
168 return *textMesh_;
179 void writeUniformValues(helios::rendering::shader::UniformValueMap& uniformValueMap) const noexcept override {
180 textRenderPrototype_->textProperties().writeUniformValues(uniformValueMap);
182 if (textPropertiesOverride_) {
183 textPropertiesOverride_->writeUniformValues(uniformValueMap);
198 helios::rendering::RenderQueue& renderQueue,
199 helios::rendering::shader::UniformValueMap& objectUniformValues,
200 helios::rendering::shader::UniformValueMap& materialUniformValues) const override {
203 writeUniformValues(materialUniformValues);
205 renderQueue.add(helios::rendering::text::TextRenderCommand(
206 textMesh_.get(),
207 textRenderPrototype_.get(),
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.