The bits of this structure can be directly reinterpreted as a float-packed color which uses the PIXELFORMAT_RGBA128_FLOAT format.
More...
|
constexpr | FColor (const SDL_FColor &color={}) |
| Wraps FColor.
|
|
constexpr | FColor (float r, float g, float b, float a=1) |
| Constructs from its fields.
|
|
constexpr auto | operator<=> (const FColor &other) const |
| Default comparison operator.
|
|
constexpr auto | operator<=> (const SDL_FColor &color) const |
| Compares with the underlying type.
|
|
constexpr float | GetR () const |
| Get the red component from the color.
|
|
constexpr FColor & | SetR (float newR) |
| Set the red component from the color.
|
|
constexpr float | GetG () const |
| Get the green component from the color.
|
|
constexpr FColor & | SetG (float newG) |
| Set the green component from the color.
|
|
constexpr float | GetB () const |
| Get the blue component from the color.
|
|
constexpr FColor & | SetB (float newB) |
| Set the blue component from the color.
|
|
constexpr float | GetA () const |
| Get the alpha component from the color.
|
|
constexpr FColor & | SetA (float newA) |
| Set the alpha component from the color.
|
|
- Since
- This struct is available since SDL 3.2.0.
- Category:
- Wrap extending struct
- See also
- Color
◆ FColor() [1/2]
constexpr SDL::FColor::FColor |
( |
const SDL_FColor & |
color = {} | ) |
|
|
inlineconstexpr |
- Parameters
-
color | the value to be wrapped |
◆ FColor() [2/2]
constexpr SDL::FColor::FColor |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b, |
|
|
float |
a = 1 |
|
) |
| |
|
inlineconstexpr |
- Parameters
-
r | the value for r. |
g | the value for g. |
b | the value for b. |
a | the value for a. |
◆ GetA()
constexpr float SDL::FColor::GetA |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- The alpha component from the color.
◆ GetB()
constexpr float SDL::FColor::GetB |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- The blue component from the color.
◆ GetG()
constexpr float SDL::FColor::GetG |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- The green component from the color.
◆ GetR()
constexpr float SDL::FColor::GetR |
( |
| ) |
const |
|
inlineconstexpr |
- Returns
- The red component from the color.
◆ SetA()
constexpr FColor & SDL::FColor::SetA |
( |
float |
newA | ) |
|
|
inlineconstexpr |
- Parameters
-
newA | New alpha component value. |
- Returns
- Reference to self.
◆ SetB()
constexpr FColor & SDL::FColor::SetB |
( |
float |
newB | ) |
|
|
inlineconstexpr |
- Parameters
-
newB | New blue component value. |
- Returns
- Reference to self.
◆ SetG()
constexpr FColor & SDL::FColor::SetG |
( |
float |
newG | ) |
|
|
inlineconstexpr |
- Parameters
-
newG | New green component value. |
- Returns
- Reference to self.
◆ SetR()
constexpr FColor & SDL::FColor::SetR |
( |
float |
newR | ) |
|
|
inlineconstexpr |
- Parameters
-
newR | New red component value. |
- Returns
- Reference to self.
The documentation for this struct was generated from the following file: