4#include <SDL3/SDL_touch.h>
5#include "SDL3pp_error.h"
6#include "SDL3pp_mouse.h"
7#include "SDL3pp_stdinc.h"
69 SDL_TOUCH_DEVICE_INVALID;
72 SDL_TOUCH_DEVICE_DIRECT;
75 SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE;
79 SDL_TOUCH_DEVICE_INDIRECT_RELATIVE;
113 constexpr Finger(SDL_FingerID
id,
float x,
float y,
float pressure)
123 constexpr explicit operator bool()
const {
return id != 0; }
130 constexpr SDL_FingerID
GetId()
const {
return id; }
149 constexpr float GetX()
const {
return x; }
168 constexpr float GetY()
const {
return y; }
197 pressure = newPressure;
231 auto data = SDL_GetTouchDevices(&count);
246 return SDL_GetTouchDeviceName(touchID);
259 return SDL_GetTouchDeviceType(touchID);
274 auto data =
reinterpret_cast<Finger**
>(SDL_GetTouchFingers(touchID, &count));
Base class for SDL memory allocated array wrap.
Definition: SDL3pp_ownPtr.h:44
SDL_MouseID MouseID
This is a unique ID for a mouse for the time it is connected to the system, and is never reused for t...
Definition: SDL3pp_mouse.h:170
TouchDeviceType GetTouchDeviceType(TouchID touchID)
Get the type of the given touch device.
Definition: SDL3pp_touch.h:257
SDL_TouchID TouchID
A unique ID for a touch device.
Definition: SDL3pp_touch.h:45
SDL_TouchDeviceType TouchDeviceType
An enum that describes the type of a touch device.
Definition: SDL3pp_touch.h:66
OwnArray< Finger * > GetTouchFingers(TouchID touchID)
Get a list of active fingers for a given touch device.
Definition: SDL3pp_touch.h:271
const char * GetTouchDeviceName(TouchID touchID)
Get the touch device name as reported from the driver.
Definition: SDL3pp_touch.h:244
OwnArray< TouchID > GetTouchDevices()
Get a list of registered touch devices.
Definition: SDL3pp_touch.h:228
SDL_FingerID FingerID
A unique ID for a single finger on a touch device.
Definition: SDL3pp_touch.h:59
constexpr MouseID TOUCH_MOUSEID
The MouseID for mouse events simulated with touch input.
Definition: SDL3pp_touch.h:207
constexpr TouchDeviceType TOUCH_DEVICE_INVALID
TOUCH_DEVICE_INVALID.
Definition: SDL3pp_touch.h:68
constexpr TouchID MOUSE_TOUCHID
The TouchID for touch events simulated with mouse input.
Definition: SDL3pp_touch.h:214
SDL_Finger FingerRaw
Alias to raw representation for Finger.
Definition: SDL3pp_touch.h:30
constexpr TouchDeviceType TOUCH_DEVICE_INDIRECT_ABSOLUTE
trackpad with absolute device coordinates
Definition: SDL3pp_touch.h:74
constexpr TouchDeviceType TOUCH_DEVICE_DIRECT
touch screen with window-relative coordinates
Definition: SDL3pp_touch.h:71
constexpr TouchDeviceType TOUCH_DEVICE_INDIRECT_RELATIVE
trackpad with screen cursor-relative coordinates
Definition: SDL3pp_touch.h:78
Main include header for the SDL3pp library.
Data about a single finger in a multitouch event.
Definition: SDL3pp_touch.h:94
constexpr float GetPressure() const
Get the pressure.
Definition: SDL3pp_touch.h:187
constexpr Finger & SetId(SDL_FingerID newId)
Set the id.
Definition: SDL3pp_touch.h:138
constexpr Finger(const FingerRaw &finger={})
Wraps Finger.
Definition: SDL3pp_touch.h:100
constexpr Finger & SetPressure(float newPressure)
Set the pressure.
Definition: SDL3pp_touch.h:195
constexpr SDL_FingerID GetId() const
Get the id.
Definition: SDL3pp_touch.h:130
constexpr float GetX() const
Get the x.
Definition: SDL3pp_touch.h:149
constexpr Finger & SetX(float newX)
Set the x.
Definition: SDL3pp_touch.h:157
constexpr Finger & SetY(float newY)
Set the y.
Definition: SDL3pp_touch.h:176
constexpr float GetY() const
Get the y.
Definition: SDL3pp_touch.h:168
constexpr Finger(SDL_FingerID id, float x, float y, float pressure)
Constructs from its fields.
Definition: SDL3pp_touch.h:113