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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfFloatstatic final ValueLayout.OfFloatstatic final ValueLayout.OfLongstatic final ValueLayout.OfFloatstatic final ValueLayout.OfLongstatic final ValueLayout.OfLongstatic final ValueLayout.OfIntstatic final ValueLayout.OfIntstatic final ValueLayout.OfFloatstatic final ValueLayout.OfFloatstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSDL_TouchFingerEvent(@NotNull MemorySegment segment) Creates an instance of aSDL_TouchFingerEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_TouchFingerEventstatic SDL_TouchFingerEvent.Ptrstatic SDL_TouchFingerEventclone(Arena arena, SDL_TouchFingerEvent src) floatdx()dx(float value) floatdy()dy(float value) final booleanIndicates whether some other object is "equal to" this one.longfingerID()fingerID(long value) final inthashCode()Returns a hash code value for this object.floatpressure()pressure(float value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.longtimestamp(long value) final StringtoString()Returns a string representation of this record class.longtouchID()touchID(long value) inttype()type(int value) intwindowID()windowID(int value) floatx()x(float value) floaty()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_TouchFingerEventrecord class.- Parameters:
segment- the value for thesegmentrecord 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 thesegmentrecord component.
-