SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::FColor Struct Reference

The bits of this structure can be directly reinterpreted as a float-packed color which uses the PIXELFORMAT_RGBA128_FLOAT format. More...

Inheritance diagram for SDL::FColor:
Inheritance graph
[legend]

Public Member Functions

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 FColorSetR (float newR)
 Set the red component from the color.
 
constexpr float GetG () const
 Get the green component from the color.
 
constexpr FColorSetG (float newG)
 Set the green component from the color.
 
constexpr float GetB () const
 Get the blue component from the color.
 
constexpr FColorSetB (float newB)
 Set the blue component from the color.
 
constexpr float GetA () const
 Get the alpha component from the color.
 
constexpr FColorSetA (float newA)
 Set the alpha component from the color.
 

Detailed Description

Since
This struct is available since SDL 3.2.0.
Category:
Wrap extending struct
See also
Color

Constructor & Destructor Documentation

◆ FColor() [1/2]

constexpr SDL::FColor::FColor ( const SDL_FColor &  color = {})
inlineconstexpr
Parameters
colorthe value to be wrapped

◆ FColor() [2/2]

constexpr SDL::FColor::FColor ( float  r,
float  g,
float  b,
float  a = 1 
)
inlineconstexpr
Parameters
rthe value for r.
gthe value for g.
bthe value for b.
athe value for a.

Member Function Documentation

◆ 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
newANew alpha component value.
Returns
Reference to self.

◆ SetB()

constexpr FColor & SDL::FColor::SetB ( float  newB)
inlineconstexpr
Parameters
newBNew blue component value.
Returns
Reference to self.

◆ SetG()

constexpr FColor & SDL::FColor::SetG ( float  newG)
inlineconstexpr
Parameters
newGNew green component value.
Returns
Reference to self.

◆ SetR()

constexpr FColor & SDL::FColor::SetR ( float  newR)
inlineconstexpr
Parameters
newRNew red component value.
Returns
Reference to self.

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