4#include <SDL3/SDL_touch.h>
5#include "SDL3pp_error.h"
6#include "SDL3pp_mouse.h"
7#include "SDL3pp_stdinc.h"
67 SDL_TOUCH_DEVICE_INVALID;
70 SDL_TOUCH_DEVICE_DIRECT;
73 SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE;
77 SDL_TOUCH_DEVICE_INDIRECT_RELATIVE;
111 constexpr Finger(SDL_FingerID
id,
float x,
float y,
float pressure)
121 constexpr explicit operator bool()
const {
return id != 0; }
128 constexpr SDL_FingerID
GetId()
const {
return id; }
147 constexpr float GetX()
const {
return x; }
166 constexpr float GetY()
const {
return y; }
195 pressure = newPressure;
229 auto data = SDL_GetTouchDevices(&count);
244 return SDL_GetTouchDeviceName(touchID);
257 return SDL_GetTouchDeviceType(touchID);
272 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:171
TouchDeviceType GetTouchDeviceType(TouchID touchID)
Get the type of the given touch device.
Definition: SDL3pp_touch.h:255
SDL_TouchID TouchID
A unique ID for a touch device.
Definition: SDL3pp_touch.h:43
SDL_TouchDeviceType TouchDeviceType
An enum that describes the type of a touch device.
Definition: SDL3pp_touch.h:64
OwnArray< Finger * > GetTouchFingers(TouchID touchID)
Get a list of active fingers for a given touch device.
Definition: SDL3pp_touch.h:269
const char * GetTouchDeviceName(TouchID touchID)
Get the touch device name as reported from the driver.
Definition: SDL3pp_touch.h:242
OwnArray< TouchID > GetTouchDevices()
Get a list of registered touch devices.
Definition: SDL3pp_touch.h:226
SDL_FingerID FingerID
A unique ID for a single finger on a touch device.
Definition: SDL3pp_touch.h:57
constexpr MouseID TOUCH_MOUSEID
The MouseID for mouse events simulated with touch input.
Definition: SDL3pp_touch.h:205
constexpr TouchDeviceType TOUCH_DEVICE_INVALID
TOUCH_DEVICE_INVALID.
Definition: SDL3pp_touch.h:66
constexpr TouchID MOUSE_TOUCHID
The TouchID for touch events simulated with mouse input.
Definition: SDL3pp_touch.h:212
SDL_Finger FingerRaw
Alias to raw representation for Finger.
Definition: SDL3pp_touch.h:31
constexpr TouchDeviceType TOUCH_DEVICE_INDIRECT_ABSOLUTE
trackpad with absolute device coordinates
Definition: SDL3pp_touch.h:72
constexpr TouchDeviceType TOUCH_DEVICE_DIRECT
touch screen with window-relative coordinates
Definition: SDL3pp_touch.h:69
constexpr TouchDeviceType TOUCH_DEVICE_INDIRECT_RELATIVE
trackpad with screen cursor-relative coordinates
Definition: SDL3pp_touch.h:76
Main include header for the SDL3pp library.
Data about a single finger in a multitouch event.
Definition: SDL3pp_touch.h:92
constexpr float GetPressure() const
Get the pressure.
Definition: SDL3pp_touch.h:185
constexpr Finger & SetId(SDL_FingerID newId)
Set the id.
Definition: SDL3pp_touch.h:136
constexpr Finger(const FingerRaw &finger={})
Wraps Finger.
Definition: SDL3pp_touch.h:98
constexpr Finger & SetPressure(float newPressure)
Set the pressure.
Definition: SDL3pp_touch.h:193
constexpr SDL_FingerID GetId() const
Get the id.
Definition: SDL3pp_touch.h:128
constexpr float GetX() const
Get the x.
Definition: SDL3pp_touch.h:147
constexpr Finger & SetX(float newX)
Set the x.
Definition: SDL3pp_touch.h:155
constexpr Finger & SetY(float newY)
Set the y.
Definition: SDL3pp_touch.h:174
constexpr float GetY() const
Get the y.
Definition: SDL3pp_touch.h:166
constexpr Finger(SDL_FingerID id, float x, float y, float pressure)
Constructs from its fields.
Definition: SDL3pp_touch.h:111