sdlGetCameraName function

String? sdlGetCameraName(
  1. int instanceId
)

Get the human-readable device name for a camera.

\param instance_id the camera device instance ID. \returns a human-readable device name or NULL on failure; call SDL_GetError() for more information.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL 3.1.3.

\sa SDL_GetCameras

extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraName(SDL_CameraID instance_id)

Implementation

String? sdlGetCameraName(int instanceId) {
  final sdlGetCameraNameLookupFunction = libSdl3.lookupFunction<
      Pointer<Utf8> Function(Uint32 instanceId),
      Pointer<Utf8> Function(int instanceId)>('SDL_GetCameraName');
  final result = sdlGetCameraNameLookupFunction(instanceId);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}