sdlGetTouchDeviceName function touch

String? sdlGetTouchDeviceName(
  1. int touchId
)

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.2.0.

extern SDL_DECLSPEC const char * SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID)

Implementation

String? sdlGetTouchDeviceName(int touchId) {
  final sdlGetTouchDeviceNameLookupFunction = _libSdl
      .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();
}