Package org.lwjgl.sdl

Class SDL_HapticCustom

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_HapticCustom extends Struct<SDL_HapticCustom> implements NativeResource

 struct SDL_HapticCustom {
     Uint16 type;
     {@link SDL_HapticDirection 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;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • DIRECTION

      public static final int DIRECTION
      The struct member offsets.
    • LENGTH

      public static final int LENGTH
      The struct member offsets.
    • DELAY

      public static final int DELAY
      The struct member offsets.
    • BUTTON

      public static final int BUTTON
      The struct member offsets.
    • INTERVAL

      public static final int INTERVAL
      The struct member offsets.
    • CHANNELS

      public static final int CHANNELS
      The struct member offsets.
    • PERIOD

      public static final int PERIOD
      The struct member offsets.
    • SAMPLES

      public static final int SAMPLES
      The struct member offsets.
    • DATA

      public static final int DATA
      The struct member offsets.
    • ATTACK_LENGTH

      public static final int ATTACK_LENGTH
      The struct member offsets.
    • ATTACK_LEVEL

      public static final int ATTACK_LEVEL
      The struct member offsets.
    • FADE_LENGTH

      public static final int FADE_LENGTH
      The struct member offsets.
    • FADE_LEVEL

      public static final int FADE_LEVEL
      The struct member offsets.
  • Constructor Details

    • SDL_HapticCustom

      public SDL_HapticCustom(ByteBuffer container)
      Creates a SDL_HapticCustom instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SDL_HapticCustom>
    • type

      public short type()
      Returns:
      the value of the type field.
    • direction

      public SDL_HapticDirection direction()
      Returns:
      a SDL_HapticDirection view of the direction field.
    • length

      public int length()
      Returns:
      the value of the length field.
    • delay

      public short delay()
      Returns:
      the value of the delay field.
    • button

      public short button()
      Returns:
      the value of the button field.
    • interval

      public short interval()
      Returns:
      the value of the interval field.
    • channels

      public byte channels()
      Returns:
      the value of the channels field.
    • period

      public short period()
      Returns:
      the value of the period field.
    • samples

      public short samples()
      Returns:
      the value of the samples field.
    • data

      public ShortBuffer data()
      Returns:
      a ShortBuffer view of the data pointed to by the data field.
    • attack_length

      public short attack_length()
      Returns:
      the value of the attack_length field.
    • attack_level

      public short attack_level()
      Returns:
      the value of the attack_level field.
    • fade_length

      public short fade_length()
      Returns:
      the value of the fade_length field.
    • fade_level

      public short fade_level()
      Returns:
      the value of the fade_level field.
    • type

      public SDL_HapticCustom type(short value)
      Sets the specified value to the type field.
    • direction

      public SDL_HapticCustom direction(SDL_HapticDirection value)
      Copies the specified SDL_HapticDirection to the direction field.
    • direction

      public SDL_HapticCustom direction(Consumer<SDL_HapticDirection> consumer)
      Passes the direction field to the specified Consumer.
    • length

      public SDL_HapticCustom length(int value)
      Sets the specified value to the length field.
    • delay

      public SDL_HapticCustom delay(short value)
      Sets the specified value to the delay field.
    • button

      public SDL_HapticCustom button(short value)
      Sets the specified value to the button field.
    • interval

      public SDL_HapticCustom interval(short value)
      Sets the specified value to the interval field.
    • channels

      public SDL_HapticCustom channels(byte value)
      Sets the specified value to the channels field.
    • period

      public SDL_HapticCustom period(short value)
      Sets the specified value to the period field.
    • samples

      public SDL_HapticCustom samples(short value)
      Sets the specified value to the samples field.
    • data

      public SDL_HapticCustom data(ShortBuffer value)
      Sets the address of the specified ShortBuffer to the data field.
    • attack_length

      public SDL_HapticCustom attack_length(short value)
      Sets the specified value to the attack_length field.
    • attack_level

      public SDL_HapticCustom attack_level(short value)
      Sets the specified value to the attack_level field.
    • fade_length

      public SDL_HapticCustom fade_length(short value)
      Sets the specified value to the fade_length field.
    • fade_level

      public SDL_HapticCustom fade_level(short value)
      Sets the specified value to the fade_level field.
    • set

      public SDL_HapticCustom set(short type, SDL_HapticDirection direction, int length, short delay, short button, short interval, byte channels, short period, short samples, ShortBuffer data, short attack_length, short attack_level, short fade_length, short fade_level)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static SDL_HapticCustom malloc()
      Returns a new SDL_HapticCustom instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static SDL_HapticCustom calloc()
      Returns a new SDL_HapticCustom instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static SDL_HapticCustom create()
      Returns a new SDL_HapticCustom instance allocated with BufferUtils.
    • create

      public static SDL_HapticCustom create(long address)
      Returns a new SDL_HapticCustom instance for the specified memory address.
    • createSafe

      public static @Nullable SDL_HapticCustom createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_HapticCustom.Buffer malloc(int capacity)
      Returns a new SDL_HapticCustom.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static SDL_HapticCustom.Buffer calloc(int capacity)
      Returns a new SDL_HapticCustom.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_HapticCustom.Buffer create(int capacity)
      Returns a new SDL_HapticCustom.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static SDL_HapticCustom.Buffer create(long address, int capacity)
      Create a SDL_HapticCustom.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable SDL_HapticCustom.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static SDL_HapticCustom malloc(MemoryStack stack)
      Returns a new SDL_HapticCustom instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static SDL_HapticCustom calloc(MemoryStack stack)
      Returns a new SDL_HapticCustom instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static SDL_HapticCustom.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SDL_HapticCustom.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static SDL_HapticCustom.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new SDL_HapticCustom.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ntype

      public static short ntype(long struct)
      Unsafe version of type().
    • ndirection

      public static SDL_HapticDirection ndirection(long struct)
      Unsafe version of direction().
    • nlength

      public static int nlength(long struct)
      Unsafe version of length().
    • ndelay

      public static short ndelay(long struct)
      Unsafe version of delay().
    • nbutton

      public static short nbutton(long struct)
      Unsafe version of button().
    • ninterval

      public static short ninterval(long struct)
      Unsafe version of interval().
    • nchannels

      public static byte nchannels(long struct)
      Unsafe version of channels().
    • nperiod

      public static short nperiod(long struct)
      Unsafe version of period().
    • nsamples

      public static short nsamples(long struct)
      Unsafe version of samples().
    • ndata

      public static ShortBuffer ndata(long struct)
      Unsafe version of data.
    • nattack_length

      public static short nattack_length(long struct)
      Unsafe version of attack_length().
    • nattack_level

      public static short nattack_level(long struct)
      Unsafe version of attack_level().
    • nfade_length

      public static short nfade_length(long struct)
      Unsafe version of fade_length().
    • nfade_level

      public static short nfade_level(long struct)
      Unsafe version of fade_level().
    • ntype

      public static void ntype(long struct, short value)
      Unsafe version of type.
    • ndirection

      public static void ndirection(long struct, SDL_HapticDirection value)
      Unsafe version of direction.
    • nlength

      public static void nlength(long struct, int value)
      Unsafe version of length.
    • ndelay

      public static void ndelay(long struct, short value)
      Unsafe version of delay.
    • nbutton

      public static void nbutton(long struct, short value)
      Unsafe version of button.
    • ninterval

      public static void ninterval(long struct, short value)
      Unsafe version of interval.
    • nchannels

      public static void nchannels(long struct, byte value)
      Unsafe version of channels.
    • nperiod

      public static void nperiod(long struct, short value)
      Unsafe version of period.
    • nsamples

      public static void nsamples(long struct, short value)
      Unsafe version of samples.
    • ndata

      public static void ndata(long struct, ShortBuffer value)
      Unsafe version of data.
    • nattack_length

      public static void nattack_length(long struct, short value)
      Unsafe version of attack_length.
    • nattack_level

      public static void nattack_level(long struct, short value)
      Unsafe version of attack_level.
    • nfade_length

      public static void nfade_length(long struct, short value)
      Unsafe version of fade_length.
    • nfade_level

      public static void nfade_level(long struct, short value)
      Unsafe version of fade_level.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate