Record Class SDL_TouchFingerEvent
- All Implemented Interfaces:
IPointer
,ISDL_TouchFingerEvent
Touch finger event structure (event.tfinger.*)
Coordinates in this event are normalized. x
and y
are normalized to a
range between 0.0f and 1.0f, relative to the window, so (0,0) is the top
left and (1,1) is the bottom right. Delta coordinates dx
and dy
are
normalized in the ranges of -1.0f (traversed all the way from the bottom or
right to all the way up or left) to 1.0f (traversed all the way from the
top or left to all the way down or right).
Note that while the coordinates are normalized, they are not clamped, which means in some circumstances you can get a value outside of this range. For example, a renderer using logical presentation might give a negative value when the touch is in the letterboxing. Some platforms might report a touch outside of the window, which will also be outside of the range.
Since: This struct is available since SDL 3.2.0.
Structure
typedef struct SDL_TouchFingerEvent {
SDL_EventType
type
;
Uint32 reserved;
Uint64 timestamp
;
SDL_TouchID touchID
;
SDL_FingerID fingerID
;
float x
;
float y
;
float dx
;
float dy
;
float pressure
;
SDL_WindowID windowID
;
} SDL_TouchFingerEvent;
Contracts
The property segment()
should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)
), and properly aligned to
LAYOUT.byteAlignment()
bytes. To represent null pointer, you may use a Java
null
instead. See the documentation of IPointer.segment()
for more details.
The constructor of this class is marked as UnsafeConstructor
, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfFloat
static final ValueLayout.OfFloat
static final ValueLayout.OfLong
static final ValueLayout.OfFloat
static final ValueLayout.OfLong
static final ValueLayout.OfLong
static final ValueLayout.OfInt
static final ValueLayout.OfInt
static final ValueLayout.OfFloat
static final ValueLayout.OfFloat
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionSDL_TouchFingerEvent
(@NotNull MemorySegment segment) Creates an instance of aSDL_TouchFingerEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_TouchFingerEvent
static SDL_TouchFingerEvent.Ptr
static SDL_TouchFingerEvent
clone
(Arena arena, SDL_TouchFingerEvent src) float
dx()
dx
(float value) float
dy()
dy
(float value) final boolean
Indicates whether some other object is "equal to" this one.long
fingerID()
fingerID
(long value) final int
hashCode()
Returns a hash code value for this object.float
pressure()
pressure
(float value) @NotNull MemorySegment
segment()
Returns the value of thesegment
record component.long
timestamp
(long value) final String
toString()
Returns a string representation of this record class.long
touchID()
touchID
(long value) int
type()
type
(int value) int
windowID()
windowID
(int value) float
x()
x
(float value) float
y()
y
(float value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$type
-
PATH$timestamp
-
PATH$touchID
-
PATH$fingerID
-
PATH$x
-
PATH$y
-
PATH$dx
-
PATH$dy
-
PATH$pressure
-
PATH$windowID
-
LAYOUT$type
-
LAYOUT$timestamp
-
LAYOUT$touchID
-
LAYOUT$fingerID
-
LAYOUT$x
-
LAYOUT$y
-
LAYOUT$dx
-
LAYOUT$dy
-
LAYOUT$pressure
-
LAYOUT$windowID
-
SIZE$type
public static final long SIZE$type -
SIZE$timestamp
public static final long SIZE$timestamp -
SIZE$touchID
public static final long SIZE$touchID -
SIZE$fingerID
public static final long SIZE$fingerID -
SIZE$x
public static final long SIZE$x -
SIZE$y
public static final long SIZE$y -
SIZE$dx
public static final long SIZE$dx -
SIZE$dy
public static final long SIZE$dy -
SIZE$pressure
public static final long SIZE$pressure -
SIZE$windowID
public static final long SIZE$windowID -
OFFSET$type
public static final long OFFSET$type -
OFFSET$timestamp
public static final long OFFSET$timestamp -
OFFSET$touchID
public static final long OFFSET$touchID -
OFFSET$fingerID
public static final long OFFSET$fingerID -
OFFSET$x
public static final long OFFSET$x -
OFFSET$y
public static final long OFFSET$y -
OFFSET$dx
public static final long OFFSET$dx -
OFFSET$dy
public static final long OFFSET$dy -
OFFSET$pressure
public static final long OFFSET$pressure -
OFFSET$windowID
public static final long OFFSET$windowID
-
-
Constructor Details
-
SDL_TouchFingerEvent
Creates an instance of aSDL_TouchFingerEvent
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
type
-
type
-
timestamp
-
timestamp
-
touchID
-
touchID
-
fingerID
-
fingerID
-
x
public float x() -
x
-
y
public float y() -
y
-
dx
public float dx() -
dx
-
dy
public float dy() -
dy
-
pressure
public float pressure() -
pressure
-
windowID
-
windowID
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
segment
Returns the value of thesegment
record component.
-