Skip to main content

TextShaderPropertiesOverride.ixx File

Optional overrides for text shader properties. More...

Included Headers

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespacetext

Text rendering abstractions and data types. More...

Classes Index

structTextShaderPropertiesOverride

Optional overrides for text shader properties. More...

Description

Optional overrides for text shader properties.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file TextShaderPropertiesOverride.ixx
3 * @brief Optional overrides for text shader properties.
4 */
5module;
6
7#include <optional>
8
9export module helios.rendering.text.TextShaderPropertiesOverride;
10
11
12import helios.math.types;
13import helios.rendering.shader.UniformValueMap;
14import helios.rendering.shader.UniformSemantics;
15
16
17export namespace helios::rendering::text {
18
19 /**
20 * @brief Optional overrides for text shader properties.
21 *
22 * `TextShaderPropertiesOverride` allows individual `TextRenderable` instances
23 * to override specific properties defined in the shared `TextShaderProperties`.
24 * Only the properties that are set (non-nullopt) will override the base values.
25 *
26 * ## Design
27 *
28 * This pattern allows sharing a common `TextRenderPrototype` while still
29 * enabling per-instance customization:
30 *
31 * ```cpp
32 * // Shared prototype with white text
33 * auto prototype = std::make_shared<TextRenderPrototype>(shader, textProps, fontProvider);
34 *
35 * // Override color for a specific renderable
36 * TextShaderPropertiesOverride override;
37 * override.baseColor = helios::util::Colors::Red;
38 *
39 * TextRenderable highlight(std::move(mesh), prototype, override);
40 * ```
41 *
42 * @see TextShaderProperties
43 * @see TextRenderable
44 */
46
47 /**
48 * @brief Optional override for the text color.
49 *
50 * When set, this color overrides the base color from `TextShaderProperties`.
51 */
52 std::optional<helios::math::vec4f> baseColor;
53
54 /**
55 * @brief Creates a new override with the given base color.
56 *
57 * @param color The color to set.
58 *
59 * @return A new TextShaderPropertiesOverride with the color set.
60 */
63 }
64
65 /**
66 * @brief Writes override values to a uniform value map.
67 *
68 * Only writes values that are set (non-nullopt). This method should be
69 * called after the base `TextShaderProperties::writeUniformValues()` to
70 * apply the overrides.
71 *
72 * @param uniformValueMap The uniform value map to write to.
73 */
74 void writeUniformValues(helios::rendering::shader::UniformValueMap& uniformValueMap) const noexcept {
75
76 if (baseColor) {
78 }
79
80 }
81
82 };
83}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.