Record Class SDL_HapticCustom

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_HapticCustom
All Implemented Interfaces:
IPointer, ISDL_HapticCustom

@ValueBasedCandidate @UnsafeConstructor public record SDL_HapticCustom(@NotNull MemorySegment segment) extends Record implements ISDL_HapticCustom

A structure containing a template for the SDL_HAPTIC_CUSTOM effect.

This struct is exclusively for the SDL_HAPTIC_CUSTOM effect.

A custom force feedback effect is much like a periodic effect, where the application can define its exact shape. You will have to allocate the data yourself. Data should consist of channels * samples Uint16 samples.

If channels is one, the effect is rotated using the defined direction. Otherwise it uses the samples in data for the different axes.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_HAPTIC_CUSTOM
  • SDL_HapticEffect

Structure

typedef struct SDL_HapticCustom {
    Uint16 type;
    SDL_HapticDirection direction;
    Uint32 length;
    Uint16 delay;
    Uint16 button;
    Uint16 interval;
    Uint8 channels;
    Uint16 period;
    Uint16 samples;
    Uint16* data;
    Uint16 attack_length;
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
} SDL_HapticCustom;

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.