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;
123 constexpr explicit operator bool() const noexcept {
return id != 0; }
149 constexpr float GetX() const noexcept {
return x; }
168 constexpr float GetY() const noexcept {
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 GetX() const noexcept
Get the x.
Definition: SDL3pp_touch.h:149
constexpr Finger & SetId(FingerID newId) noexcept
Set the id.
Definition: SDL3pp_touch.h:138
constexpr Finger(const FingerRaw &finger={}) noexcept
Wraps Finger.
Definition: SDL3pp_touch.h:100
constexpr Finger & SetPressure(float newPressure) noexcept
Set the pressure.
Definition: SDL3pp_touch.h:195
constexpr float GetPressure() const noexcept
Get the pressure.
Definition: SDL3pp_touch.h:187
constexpr Finger & SetY(float newY) noexcept
Set the y.
Definition: SDL3pp_touch.h:176
constexpr Finger(FingerID id, float x, float y, float pressure) noexcept
Constructs from its fields.
Definition: SDL3pp_touch.h:113
constexpr Finger & SetX(float newX) noexcept
Set the x.
Definition: SDL3pp_touch.h:157
constexpr FingerID GetId() const noexcept
Get the id.
Definition: SDL3pp_touch.h:130
constexpr float GetY() const noexcept
Get the y.
Definition: SDL3pp_touch.h:168