Record Class SDL_VirtualJoystickDesc

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_VirtualJoystickDesc
All Implemented Interfaces:
IPointer, ISDL_VirtualJoystickDesc

@ValueBasedCandidate @UnsafeConstructor public record SDL_VirtualJoystickDesc(@NotNull MemorySegment segment) extends Record implements ISDL_VirtualJoystickDesc

The structure that describes a virtual joystick.

This structure should be initialized using SDL_INIT_INTERFACE(). All elements of this structure are optional.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_AttachVirtualJoystick
  • SDL_INIT_INTERFACE
  • SDL_VirtualJoystickSensorDesc
  • SDL_VirtualJoystickTouchpadDesc

Structure

typedef struct SDL_VirtualJoystickDesc {
    Uint32 version;
    Uint16 type;
    Uint16 padding;
    Uint16 vendor_id;
    Uint16 product_id;
    Uint16 naxes;
    Uint16 nbuttons;
    Uint16 nballs;
    Uint16 nhats;
    Uint16 ntouchpads;
    Uint16 nsensors;
    Uint16[2] padding2;
    Uint32 button_mask;
    Uint32 axis_mask;
    char const* name;
    SDL_VirtualJoystickTouchpadDesc const* touchpads;
    SDL_VirtualJoystickSensorDesc const* sensors;
    void* userdata;
    PFN_SDL_VirtualJoystickDesc_Update Update; // optional
    PFN_SDL_VirtualJoystickDesc_SetPlayerIndex SetPlayerIndex; // optional
    PFN_SDL_VirtualJoystickDesc_Rumble Rumble; // optional
    PFN_SDL_VirtualJoystickDesc_RumbleTriggers RumbleTriggers; // optional
    PFN_SDL_VirtualJoystickDesc_SetLED SetLED; // optional
    PFN_SDL_VirtualJoystickDesc_SendEffect SendEffect; // optional
    PFN_SDL_VirtualJoystickDesc_SetSensorsEnabled SetSensorsEnabled; // optional
    PFN_SDL_VirtualJoystickDesc_Cleanup Cleanup; // optional
} SDL_VirtualJoystickDesc;

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.