SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
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:
[legend]

Public Member Functions

constexpr FColor (const FColorRaw &color={}) noexcept
 Wraps FColor.
constexpr FColor (float r, float g, float b, float a=1) noexcept
 Constructs from its fields.
constexpr float GetR () const noexcept
 Get the red component from the color.
constexpr FColor & SetR (float newR) noexcept
 Set the red component from the color.
constexpr float GetG () const noexcept
 Get the green component from the color.
constexpr FColor & SetG (float newG) noexcept
 Set the green component from the color.
constexpr float GetB () const noexcept
 Get the blue component from the color.
constexpr FColor & SetB (float newB) noexcept
 Set the blue component from the color.
constexpr float GetA () const noexcept
 Get the alpha component from the color.
constexpr FColor & SetA (float newA) noexcept
 Set the alpha component from the color.

Detailed Description

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

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

Constructor & Destructor Documentation

◆ FColor() [1/2]

SDL::FColor::FColor ( const FColorRaw & color = {})
inlineconstexprnoexcept

Wraps FColor.

Parameters
colorthe value to be wrapped

◆ FColor() [2/2]

SDL::FColor::FColor ( float r,
float g,
float b,
float a = 1 )
inlineconstexprnoexcept

Constructs from its fields.

Parameters
rthe value for r.
gthe value for g.
bthe value for b.
athe value for a.

Member Function Documentation

◆ GetA()

float SDL::FColor::GetA ( ) const
inlineconstexprnoexcept

Get the alpha component from the color.

Returns
The alpha component from the color.

◆ GetB()

float SDL::FColor::GetB ( ) const
inlineconstexprnoexcept

Get the blue component from the color.

Returns
The blue component from the color.

◆ GetG()

float SDL::FColor::GetG ( ) const
inlineconstexprnoexcept

Get the green component from the color.

Returns
The green component from the color.

◆ GetR()

float SDL::FColor::GetR ( ) const
inlineconstexprnoexcept

Get the red component from the color.

Returns
The red component from the color.

◆ SetA()

FColor & SDL::FColor::SetA ( float newA)
inlineconstexprnoexcept

Set the alpha component from the color.

Parameters
newANew alpha component value.
Returns
Reference to self.

◆ SetB()

FColor & SDL::FColor::SetB ( float newB)
inlineconstexprnoexcept

Set the blue component from the color.

Parameters
newBNew blue component value.
Returns
Reference to self.

◆ SetG()

FColor & SDL::FColor::SetG ( float newG)
inlineconstexprnoexcept

Set the green component from the color.

Parameters
newGNew green component value.
Returns
Reference to self.

◆ SetR()

FColor & SDL::FColor::SetR ( float newR)
inlineconstexprnoexcept

Set the red component from the color.

Parameters
newRNew red component value.
Returns
Reference to self.

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