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

The structure that defines a point (using floating point values). More...

Inheritance diagram for SDL::FPoint:
Inheritance graph
[legend]
Collaboration diagram for SDL::FPoint:
Collaboration graph
[legend]

Public Member Functions

constexpr FPoint (const FPointRaw &p={}) noexcept
 Wraps FPoint. More...
 
constexpr FPoint (float x, float y) noexcept
 Constructs from its fields. More...
 
constexpr operator bool () const noexcept
 Check if valid. More...
 
constexpr float GetX () const noexcept
 Get the x coordinate. More...
 
constexpr FPointSetX (float newX) noexcept
 Set the x coordinate. More...
 
constexpr float GetY () const noexcept
 Get the y coordinate. More...
 
constexpr FPointSetY (float newY) noexcept
 Set the y coordinate. More...
 
constexpr bool InRect (const FRectRaw &r) const
 Determine whether a point resides inside a floating point rectangle. More...
 
constexpr FPoint operator- () const
 Get point's memberwise negation. More...
 
constexpr FPoint operator+ (const FPoint &other) const
 Get point's memberwise addition with another point. More...
 
constexpr FPoint operator- (const FPoint &other) const
 Get point's memberwise subtraction with another point. More...
 
constexpr FPoint operator/ (float value) const
 Get point's memberwise division by an float. More...
 
constexpr FPoint operator/ (const FPoint &other) const
 Get point's memberwise division by another point. More...
 
constexpr FPoint operator* (float value) const
 Get point's memberwise multiplication by an float. More...
 
constexpr FPoint operator* (const FPoint &other) const
 Get point's memberwise multiplication by another point. More...
 
constexpr FPointoperator+= (const FPoint &other)
 Memberwise add another point. More...
 
constexpr FPointoperator-= (const FPoint &other)
 Memberwise subtract another point. More...
 
constexpr FPointoperator/= (float value)
 Memberwise divide by an float. More...
 
constexpr FPointoperator/= (const FPoint &other)
 Memberwise divide by another point. More...
 
constexpr FPointoperator*= (float value)
 Memberwise multiply by an float. More...
 
constexpr FPointoperator*= (const FPoint &other)
 Memberwise multiply by another point. More...
 
constexpr FPoint GetClamped (const FRect &rect) const
 Get a point with coordinates modified so it fits into a given rect. More...
 
constexpr FPointClamp (const FRect &rect)
 Clamp point coordinates to make it fit into a given rect. More...
 
constexpr FPoint GetWrapped (const FRect &rect) const
 Get a point wrapped within a specified rect. More...
 
constexpr FPointWrap (const FRect &rect)
 Wrap point coordinates within a specified rect. More...
 

Detailed Description

Since
This struct is available since SDL 3.2.0.
Category:
Wrap extending struct
See also
FRect.GetEnclosingPoints
FPoint.InRect

Constructor & Destructor Documentation

◆ FPoint() [1/2]

constexpr SDL::FPoint::FPoint ( const FPointRaw p = {})
inlineconstexprnoexcept
Parameters
pthe value to be wrapped

◆ FPoint() [2/2]

constexpr SDL::FPoint::FPoint ( float  x,
float  y 
)
inlineconstexprnoexcept
Parameters
xthe value for x.
ythe value for y.

Member Function Documentation

◆ Clamp()

constexpr FPoint & SDL::FPoint::Clamp ( const FRect rect)
constexpr
Parameters
[in]rectRectangle to clamp with
Returns
Reference to self

◆ GetClamped()

constexpr FPoint SDL::FPoint::GetClamped ( const FRect rect) const
constexpr
Parameters
[in]rectRectangle to clamp with
Returns
Clamped point

◆ GetWrapped()

constexpr FPoint SDL::FPoint::GetWrapped ( const FRect rect) const
constexpr
Parameters
[in]rectRectangle to wrap with
Returns
Wrapped point

◆ GetX()

constexpr float SDL::FPoint::GetX ( ) const
inlineconstexprnoexcept
Returns
current x value.

◆ GetY()

constexpr float SDL::FPoint::GetY ( ) const
inlineconstexprnoexcept
Returns
current y coordinate.

◆ operator bool()

constexpr SDL::FPoint::operator bool ( ) const
inlineexplicitconstexprnoexcept
Returns
True if valid state, false otherwise.

◆ operator*() [1/2]

constexpr FPoint SDL::FPoint::operator* ( const FPoint other) const
inlineconstexpr
Parameters
[in]otherMultiplier
Returns
New Point representing memberwise multiplication of point by another point

◆ operator*() [2/2]

constexpr FPoint SDL::FPoint::operator* ( float  value) const
inlineconstexpr
Parameters
[in]valueMultiplier
Returns
New Point representing memberwise multiplication of point by an float

◆ operator*=() [1/2]

constexpr FPoint & SDL::FPoint::operator*= ( const FPoint other)
inlineconstexpr
Parameters
[in]otherMultiplier
Returns
Reference to self

◆ operator*=() [2/2]

constexpr FPoint & SDL::FPoint::operator*= ( float  value)
inlineconstexpr
Parameters
[in]valueMultiplier
Returns
Reference to self

◆ operator+()

constexpr FPoint SDL::FPoint::operator+ ( const FPoint other) const
inlineconstexpr
Parameters
[in]otherPoint to add
Returns
New Point representing memberwise addition with another point

◆ operator+=()

constexpr FPoint & SDL::FPoint::operator+= ( const FPoint other)
inlineconstexpr
Parameters
[in]otherPoint to add to the current one
Returns
Reference to self

◆ operator-() [1/2]

constexpr FPoint SDL::FPoint::operator- ( ) const
inlineconstexpr
Returns
New Point representing memberwise negation

◆ operator-() [2/2]

constexpr FPoint SDL::FPoint::operator- ( const FPoint other) const
inlineconstexpr
Parameters
[in]otherPoint to subtract
Returns
New Point representing memberwise subtraction of another point

◆ operator-=()

constexpr FPoint & SDL::FPoint::operator-= ( const FPoint other)
inlineconstexpr
Parameters
[in]otherPoint to subtract from the current one
Returns
Reference to self

◆ operator/() [1/2]

constexpr FPoint SDL::FPoint::operator/ ( const FPoint other) const
inlineconstexpr
Parameters
[in]otherDivisor
Returns
New Point representing memberwise division of point by another point

◆ operator/() [2/2]

constexpr FPoint SDL::FPoint::operator/ ( float  value) const
inlineconstexpr
Parameters
[in]valueDivisor
Returns
New Point representing memberwise division of point by an float

◆ operator/=() [1/2]

constexpr FPoint & SDL::FPoint::operator/= ( const FPoint other)
inlineconstexpr
Parameters
[in]otherDivisor
Returns
Reference to self

◆ operator/=() [2/2]

constexpr FPoint & SDL::FPoint::operator/= ( float  value)
inlineconstexpr
Parameters
[in]valueDivisor
Returns
Reference to self

◆ SetX()

constexpr FPoint & SDL::FPoint::SetX ( float  newX)
inlineconstexprnoexcept
Parameters
newXthe new x coordinate.
Returns
Reference to self.

◆ SetY()

constexpr FPoint & SDL::FPoint::SetY ( float  newY)
inlineconstexprnoexcept
Parameters
newYthe new y coordinate.
Returns
Reference to self.

◆ Wrap()

constexpr FPoint & SDL::FPoint::Wrap ( const FRect rect)
constexpr
Parameters
[in]rectRectangle to wrap with
Returns
Reference to self

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