Scroll to navigation

SDL_HapticOpen(3) SDL3 FUNCTIONS SDL_HapticOpen(3)

NAME

SDL_HapticOpen - Open a haptic device for use.

SYNOPSIS

#include "SDL3/SDL.h"
SDL_Haptic* SDL_HapticOpen(int device_index);

DESCRIPTION

The index passed as an argument refers to the N'th haptic device on this system.

When opening a haptic device, its gain will be set to maximum and autocenter will be disabled. To modify these values use

SDL_HapticSetGain () and

SDL_HapticSetAutocenter ().

FUNCTION PARAMETERS

index of the device to open

RETURN VALUE

Returns the device identifier or NULL on failure; call

SDL_GetError () for more information.

AVAILABILITY

This function is available since SDL 3.0.0.

SEE ALSO

SDL_HapticClose(3), SDL_HapticIndex(3), SDL_HapticOpenFromJoystick(3), SDL_HapticOpenFromMouse(3), SDL_HapticPause(3), SDL_HapticSetAutocenter(3), SDL_HapticSetGain(3), SDL_HapticStopAll(3)

SDL 3.0.0 SDL