Record Class SDL_TouchFingerEvent

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_TouchFingerEvent
All Implemented Interfaces:
IPointer, ISDL_TouchFingerEvent

@ValueBasedCandidate @UnsafeConstructor public record SDL_TouchFingerEvent(@NotNull MemorySegment segment) extends Record implements 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.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$type

      public static final MemoryLayout.PathElement PATH$type
    • PATH$timestamp

      public static final MemoryLayout.PathElement PATH$timestamp
    • PATH$touchID

      public static final MemoryLayout.PathElement PATH$touchID
    • PATH$fingerID

      public static final MemoryLayout.PathElement PATH$fingerID
    • PATH$x

      public static final MemoryLayout.PathElement PATH$x
    • PATH$y

      public static final MemoryLayout.PathElement PATH$y
    • PATH$dx

      public static final MemoryLayout.PathElement PATH$dx
    • PATH$dy

      public static final MemoryLayout.PathElement PATH$dy
    • PATH$pressure

      public static final MemoryLayout.PathElement PATH$pressure
    • PATH$windowID

      public static final MemoryLayout.PathElement PATH$windowID
    • LAYOUT$type

      public static final ValueLayout.OfInt LAYOUT$type
    • LAYOUT$timestamp

      public static final ValueLayout.OfLong LAYOUT$timestamp
    • LAYOUT$touchID

      public static final ValueLayout.OfLong LAYOUT$touchID
    • LAYOUT$fingerID

      public static final ValueLayout.OfLong LAYOUT$fingerID
    • LAYOUT$x

      public static final ValueLayout.OfFloat LAYOUT$x
    • LAYOUT$y

      public static final ValueLayout.OfFloat LAYOUT$y
    • LAYOUT$dx

      public static final ValueLayout.OfFloat LAYOUT$dx
    • LAYOUT$dy

      public static final ValueLayout.OfFloat LAYOUT$dy
    • LAYOUT$pressure

      public static final ValueLayout.OfFloat LAYOUT$pressure
    • LAYOUT$windowID

      public static final ValueLayout.OfInt 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

      public SDL_TouchFingerEvent(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a SDL_TouchFingerEvent record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details