Record Class SDL_HapticCustom
- All Implemented Interfaces:
IPointer,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_CUSTOMSDL_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.
-
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.OfShortstatic final ValueLayout.OfShortstatic final ValueLayout.OfShortstatic final ValueLayout.OfBytestatic final AddressLayoutstatic final ValueLayout.OfShortstatic final StructLayoutstatic final ValueLayout.OfShortstatic final ValueLayout.OfShortstatic final ValueLayout.OfShortstatic final ValueLayout.OfIntstatic final ValueLayout.OfShortstatic final ValueLayout.OfShortstatic final ValueLayout.OfShortstatic final longstatic final longstatic final longstatic final longstatic 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 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 longstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSDL_HapticCustom(@NotNull MemorySegment segment) Creates an instance of aSDL_HapticCustomrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic SDL_HapticCustomstatic SDL_HapticCustom.Ptrshortattack_length(short value) shortattack_level(short value) shortbutton()button(short value) bytechannels()channels(byte value) static SDL_HapticCustomclone(Arena arena, SDL_HapticCustom src) @Nullable ShortPtrdata()Note: the returnedShortPtrdoes not have correctShortPtr.size()property.dataRaw()voiddataRaw(MemorySegment value) shortdelay()delay(short value) @NotNull SDL_HapticDirectiondirection(@NotNull SDL_HapticDirection value) direction(Consumer<@NotNull SDL_HapticDirection> consumer) final booleanIndicates whether some other object is "equal to" this one.shortfade_length(short value) shortfade_level(short value) final inthashCode()Returns a hash code value for this object.shortinterval()interval(short value) intlength()length(int value) shortperiod()period(short value) shortsamples()samples(short value) @NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()Returns a string representation of this record class.shorttype()type(short value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$type
-
PATH$direction
-
PATH$length
-
PATH$delay
-
PATH$button
-
PATH$interval
-
PATH$channels
-
PATH$period
-
PATH$samples
-
PATH$data
-
PATH$attack_length
-
PATH$attack_level
-
PATH$fade_length
-
PATH$fade_level
-
LAYOUT$type
-
LAYOUT$direction
-
LAYOUT$length
-
LAYOUT$delay
-
LAYOUT$button
-
LAYOUT$interval
-
LAYOUT$channels
-
LAYOUT$period
-
LAYOUT$samples
-
LAYOUT$data
-
LAYOUT$attack_length
-
LAYOUT$attack_level
-
LAYOUT$fade_length
-
LAYOUT$fade_level
-
SIZE$type
public static final long SIZE$type -
SIZE$direction
public static final long SIZE$direction -
SIZE$length
public static final long SIZE$length -
SIZE$delay
public static final long SIZE$delay -
SIZE$button
public static final long SIZE$button -
SIZE$interval
public static final long SIZE$interval -
SIZE$channels
public static final long SIZE$channels -
SIZE$period
public static final long SIZE$period -
SIZE$samples
public static final long SIZE$samples -
SIZE$data
public static final long SIZE$data -
SIZE$attack_length
public static final long SIZE$attack_length -
SIZE$attack_level
public static final long SIZE$attack_level -
SIZE$fade_length
public static final long SIZE$fade_length -
SIZE$fade_level
public static final long SIZE$fade_level -
OFFSET$type
public static final long OFFSET$type -
OFFSET$direction
public static final long OFFSET$direction -
OFFSET$length
public static final long OFFSET$length -
OFFSET$delay
public static final long OFFSET$delay -
OFFSET$button
public static final long OFFSET$button -
OFFSET$interval
public static final long OFFSET$interval -
OFFSET$channels
public static final long OFFSET$channels -
OFFSET$period
public static final long OFFSET$period -
OFFSET$samples
public static final long OFFSET$samples -
OFFSET$data
public static final long OFFSET$data -
OFFSET$attack_length
public static final long OFFSET$attack_length -
OFFSET$attack_level
public static final long OFFSET$attack_level -
OFFSET$fade_length
public static final long OFFSET$fade_length -
OFFSET$fade_level
public static final long OFFSET$fade_level
-
-
Constructor Details
-
SDL_HapticCustom
Creates an instance of aSDL_HapticCustomrecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
type
-
type
-
direction
-
direction
-
direction
-
length
-
length
-
delay
-
delay
-
button
-
button
-
interval
-
interval
-
channels
-
channels
-
period
-
period
-
samples
-
samples
-
data
Note: the returnedShortPtrdoes not have correctShortPtr.size()property. It's up to user to track the size of the buffer, and useShortPtr.reinterpret(long)to set the size before actually reading from or writing to the buffer. -
data
public SDL_HapticCustom data(@Nullable @Pointer(comment="Uint16") @Unsigned @Nullable ShortPtr value) -
dataRaw
-
dataRaw
-
attack_length
-
attack_length
-
attack_level
-
attack_level
-
fade_length
-
fade_length
-
fade_level
-
fade_level
-
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.
-