logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_VirtualJoystickDesc - The structure that describes a virtual joystick.

Availability

       This struct is available since SDL 3.2.0.

Description

       This structure should be initialized using

       SDL_INIT_INTERFACE (). All elements of this structure are optional.

Header File

       Defined in SDL3/SDL_joystick.h

Name

       SDL_VirtualJoystickDesc - The structure that describes a virtual joystick.

See Also

(3),          SDL_AttachVirtualJoystick(3),          (3),          SDL_INIT_INTERFACE(3),         (3),
       SDL_VirtualJoystickSensorDesc(3type), (3), SDL_VirtualJoystickTouchpadDesc(3type)

Simple Directmedia Layer                           SDL 3.2.10                     SDL_VirtualJoystickDesc(3type)

Synopsis

#include"SDL3/SDL.h"typedefstructSDL_VirtualJoystickDesc{Uint32version;/**<theversionofthisinterface*/Uint16type;/**<`SDL_JoystickType`*/Uint16padding;/**<unused*/Uint16vendor_id;/**<theUSBvendorIDofthisjoystick*/Uint16product_id;/**<theUSBproductIDofthisjoystick*/Uint16naxes;/**<thenumberofaxesonthisjoystick*/Uint16nbuttons;/**<thenumberofbuttonsonthisjoystick*/Uint16nballs;/**<thenumberofballsonthisjoystick*/Uint16nhats;/**<thenumberofhatsonthisjoystick*/Uint16ntouchpads;/**<thenumberoftouchpadsonthisjoystick,requires`touchpads`topointatvaliddescriptions*/Uint16nsensors;/**<thenumberofsensorsonthisjoystick,requires`sensors`topointatvaliddescriptions*/Uint16padding2[2];/**<unused*/Uint32button_mask;/**<Amaskofwhichbuttonsarevalidforthiscontrollere.g.(1<<SDL_GAMEPAD_BUTTON_SOUTH)*/Uint32axis_mask;/**<Amaskofwhichaxesarevalidforthiscontrollere.g.(1<<SDL_GAMEPAD_AXIS_LEFTX)*/constchar*name;/**<thenameofthejoystick*/constSDL_VirtualJoystickTouchpadDesc*touchpads;/**<Apointertoanarrayoftouchpaddescriptions,requiredif`ntouchpads`is>0*/constSDL_VirtualJoystickSensorDesc*sensors;/**<Apointertoanarrayofsensordescriptions,requiredif`nsensors`is>0*/void*userdata;/**<Userdatapointerpassedtocallbacks*/void(SDLCALL*Update)(void*userdata);/**<Calledwhenthejoystickstateshouldbeupdated*/void(SDLCALL*SetPlayerIndex)(void*userdata,intplayer_index);/**<Calledwhentheplayerindexisset*/bool(SDLCALL*Rumble)(void*userdata,Uint16low_frequency_rumble,Uint16high_frequency_rumble);/**<ImplementsSDL_RumbleJoystick()*/bool(SDLCALL*RumbleTriggers)(void*userdata,Uint16left_rumble,Uint16right_rumble);/**<ImplementsSDL_RumbleJoystickTriggers()*/bool(SDLCALL*SetLED)(void*userdata,Uint8red,Uint8green,Uint8blue);/**<ImplementsSDL_SetJoystickLED()*/bool(SDLCALL*SendEffect)(void*userdata,constvoid*data,intsize);/**<ImplementsSDL_SendJoystickEffect()*/bool(SDLCALL*SetSensorsEnabled)(void*userdata,boolenabled);/**<ImplementsSDL_SetGamepadSensorEnabled()*/void(SDLCALL*Cleanup)(void*userdata);/**<Cleansuptheuserdatawhenthejoystickisdetached*/}SDL_VirtualJoystickDesc;

See Also