sdlGetJoystickSerial function joystick
Get the serial number of an opened joystick, if available.
Returns the serial number of the joystick, or NULL if it is not available.
\param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). \returns the serial number of the selected joystick, or NULL if unavailable.
\threadsafety It is safe to call this function from any thread.
\since This function is available since SDL 3.2.0.
extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joystick)
Implementation
String? sdlGetJoystickSerial(Pointer<SdlJoystick> joystick) {
final sdlGetJoystickSerialLookupFunction = _libSdl
.lookupFunction<
Pointer<Utf8> Function(Pointer<SdlJoystick> joystick),
Pointer<Utf8> Function(Pointer<SdlJoystick> joystick)
>('SDL_GetJoystickSerial');
final result = sdlGetJoystickSerialLookupFunction(joystick);
if (result == nullptr) {
return null;
}
return result.toDartString();
}