TextShaderPropertiesOverride Struct
Optional overrides for text shader properties. More...
Declaration
Public Member Functions Index
| TextShaderPropertiesOverride | withBaseColor (helios::math::vec4f color) noexcept |
|
Creates a new override with the given base color. More... | |
| void | writeUniformValues (helios::rendering::shader::UniformValueMap &uniformValueMap) const noexcept |
|
Writes override values to a uniform value map. More... | |
Public Member Attributes Index
| std::optional< helios::math::vec4f > | baseColor |
|
Optional override for the text color. More... | |
Description
Optional overrides for text shader properties.
`TextShaderPropertiesOverride` allows individual `TextRenderable` instances to override specific properties defined in the shared `TextShaderProperties`. Only the properties that are set (non-nullopt) will override the base values.
## Design
This pattern allows sharing a common `TextRenderPrototype` while still enabling per-instance customization:
```cpp // Shared prototype with white text auto prototype = std::make_shared<TextRenderPrototype>(shader, textProps, fontProvider);
// Override color for a specific renderable TextShaderPropertiesOverride override; override.baseColor = helios::util::Colors::Red;
TextRenderable highlight(std::move(mesh), prototype, override); ```
- See Also
- See Also
Definition at line 45 of file TextShaderPropertiesOverride.ixx.
Public Member Functions
withBaseColor()
| inline nodiscard noexcept |
Creates a new override with the given base color.
- Parameters
-
color The color to set.
- Returns
A new TextShaderPropertiesOverride with the color set.
Definition at line 61 of file TextShaderPropertiesOverride.ixx.
writeUniformValues()
| inline noexcept |
Writes override values to a uniform value map.
Only writes values that are set (non-nullopt). This method should be called after the base `TextShaderProperties::writeUniformValues()` to apply the overrides.
- Parameters
-
uniformValueMap The uniform value map to write to.
Definition at line 74 of file TextShaderPropertiesOverride.ixx.
References baseColor and helios::rendering::shader::TextColor.
Public Member Attributes
baseColor
|
Optional override for the text color.
When set, this color overrides the base color from `TextShaderProperties`.
Definition at line 52 of file TextShaderPropertiesOverride.ixx.
Referenced by writeUniformValues.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.