Skip to main content

TextShaderProperties Class

Immutable shader properties for text rendering. More...

Declaration

class helios::rendering::text::TextShaderProperties { ... }

Public Constructors Index

TextShaderProperties (const helios::math::vec4f baseColor=helios::util::Colors::White)

Constructs TextShaderProperties with the specified color. More...

Public Member Functions Index

voidwriteUniformValues (helios::rendering::shader::UniformValueMap &uniformValueMap) const noexcept

Writes the text shader properties to a uniform value map. More...

Private Member Attributes Index

helios::math::vec4fbaseColor_

Base text color (RGBA). More...

Description

Immutable shader properties for text rendering.

`TextShaderProperties` defines the base visual properties for rendering text, such as the text color. These properties are typically shared across multiple `TextRenderable` instances via a `TextRenderPrototype`.

## Usage

```cpp // Create text properties with a custom color auto textProps = std::make_shared<TextShaderProperties>( helios::util::Colors::Red );

// Use with a render prototype auto prototype = std::make_shared<TextRenderPrototype>(shader, textProps, fontProvider); ```

See Also

TextRenderPrototype

See Also

TextShaderPropertiesOverride

See Also

UniformSemantics::TextColor

Definition at line 47 of file TextShaderProperties.ixx.

Public Constructors

TextShaderProperties()

helios::rendering::text::TextShaderProperties::TextShaderProperties (const helios::math::vec4f baseColor=helios::util::Colors::White)
inline explicit

Constructs TextShaderProperties with the specified color.

Parameters
baseColor

The text color. Defaults to white.

Definition at line 63 of file TextShaderProperties.ixx.

65
66 ) : baseColor_(baseColor) {}

Reference helios::util::Colors::White.

Public Member Functions

writeUniformValues()

void helios::rendering::text::TextShaderProperties::writeUniformValues (helios::rendering::shader::UniformValueMap & uniformValueMap)
inline noexcept

Writes the text shader properties to a uniform value map.

Sets the `UniformSemantics::TextColor` uniform to the base color.

Parameters
uniformValueMap

The uniform value map to write to.

Definition at line 75 of file TextShaderProperties.ixx.

75 void writeUniformValues(helios::rendering::shader::UniformValueMap& uniformValueMap) const noexcept {
76 uniformValueMap.set(helios::rendering::shader::UniformSemantics::TextColor, baseColor_);
77 }

Reference helios::rendering::shader::TextColor.

Private Member Attributes

baseColor_

helios::math::vec4f helios::rendering::text::TextShaderProperties::baseColor_

Base text color (RGBA).

Definition at line 54 of file TextShaderProperties.ixx.

54 helios::math::vec4f baseColor_;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.