sdlGetTouchDeviceName function
Get the touch device name as reported from the driver.
\param touchID the touch device instance ID. \returns touch device name, or NULL on failure; call SDL_GetError() for more information.
\since This function is available since SDL 3.1.3.
extern SDL_DECLSPEC const char * SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID)
Implementation
String? sdlGetTouchDeviceName(int touchId) {
final sdlGetTouchDeviceNameLookupFunction = libSdl3.lookupFunction<
Pointer<Utf8> Function(Uint64 touchId),
Pointer<Utf8> Function(int touchId)>('SDL_GetTouchDeviceName');
final result = sdlGetTouchDeviceNameLookupFunction(touchId);
if (result == nullptr) {
return null;
}
return result.toDartString();
}