SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
SDL::Finger Struct Reference

Data about a single finger in a multitouch event. More...

Inheritance diagram for SDL::Finger:
[legend]

Public Member Functions

constexpr Finger (const FingerRaw &finger={}) noexcept
 Wraps Finger.
constexpr Finger (FingerID id, float x, float y, float pressure) noexcept
 Constructs from its fields.
constexpr operator bool () const noexcept
 Check if valid.
constexpr FingerID GetId () const noexcept
 Get the id.
constexpr FingerSetId (FingerID newId) noexcept
 Set the id.
constexpr float GetX () const noexcept
 Get the x.
constexpr FingerSetX (float newX) noexcept
 Set the x.
constexpr float GetY () const noexcept
 Get the y.
constexpr FingerSetY (float newY) noexcept
 Set the y.
constexpr float GetPressure () const noexcept
 Get the pressure.
constexpr FingerSetPressure (float newPressure) noexcept
 Set the pressure.

Detailed Description

Data about a single finger in a multitouch event.

Each touch event is a collection of fingers that are simultaneously in contact with the touch device (so a "touch" can be a "multitouch," in reality), and this struct reports details of the specific fingers.

Since
This struct is available since SDL 3.2.0.
See also
GetTouchFingers

Constructor & Destructor Documentation

◆ Finger() [1/2]

SDL::Finger::Finger ( const FingerRaw & finger = {})
inlineconstexprnoexcept

Wraps Finger.

Parameters
fingerthe value to be wrapped

◆ Finger() [2/2]

SDL::Finger::Finger ( FingerID id,
float x,
float y,
float pressure )
inlineconstexprnoexcept

Constructs from its fields.

Parameters
idthe value for id.
xthe value for x.
ythe value for y.
pressurethe value for pressure.

Member Function Documentation

◆ GetId()

FingerID SDL::Finger::GetId ( ) const
inlineconstexprnoexcept

Get the id.

Returns
current id value.

◆ GetPressure()

float SDL::Finger::GetPressure ( ) const
inlineconstexprnoexcept

Get the pressure.

Returns
current pressure value.

◆ GetX()

float SDL::Finger::GetX ( ) const
inlineconstexprnoexcept

Get the x.

Returns
current x value.

◆ GetY()

float SDL::Finger::GetY ( ) const
inlineconstexprnoexcept

Get the y.

Returns
current y value.

◆ operator bool()

SDL::Finger::operator bool ( ) const
inlineexplicitconstexprnoexcept

Check if valid.

Returns
True if valid state, false otherwise.

◆ SetId()

Finger & SDL::Finger::SetId ( FingerID newId)
inlineconstexprnoexcept

Set the id.

Parameters
newIdthe new id value.
Returns
Reference to self.

◆ SetPressure()

Finger & SDL::Finger::SetPressure ( float newPressure)
inlineconstexprnoexcept

Set the pressure.

Parameters
newPressurethe new pressure value.
Returns
Reference to self.

◆ SetX()

Finger & SDL::Finger::SetX ( float newX)
inlineconstexprnoexcept

Set the x.

Parameters
newXthe new x value.
Returns
Reference to self.

◆ SetY()

Finger & SDL::Finger::SetY ( float newY)
inlineconstexprnoexcept

Set the y.

Parameters
newYthe new y value.
Returns
Reference to self.

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