Record Class SDL_HapticConstant

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_HapticConstant
All Implemented Interfaces:
IPointer, ISDL_HapticConstant

@ValueBasedCandidate @UnsafeConstructor public record SDL_HapticConstant(@NotNull MemorySegment segment) extends Record implements ISDL_HapticConstant

A structure containing a template for a Constant effect.

This struct is exclusively for the SDL_HAPTIC_CONSTANT effect.

A constant effect applies a constant force in the specified direction to the joystick.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_HAPTIC_CONSTANT
  • SDL_HapticEffect

Structure

typedef struct SDL_HapticConstant {
    Uint16 type;
    SDL_HapticDirection direction;
    Uint32 length;
    Uint16 delay;
    Uint16 button;
    Uint16 interval;
    Sint16 level;
    Uint16 attack_length;
    Uint16 attack_level;
    Uint16 fade_length;
    Uint16 fade_level;
} SDL_HapticConstant;

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.