sdlGetGpuDeviceDriver function gpu

String? sdlGetGpuDeviceDriver(
  1. Pointer<SdlGpuDevice> device
)

Returns the name of the backend used to create this GPU context.

\param device a GPU context to query. \returns the name of the device's driver, or NULL on error.

\since This function is available since SDL 3.2.0.

extern SDL_DECLSPEC const char * SDLCALL SDL_GetGPUDeviceDriver(SDL_GPUDevice *device)

Implementation

String? sdlGetGpuDeviceDriver(Pointer<SdlGpuDevice> device) {
  final sdlGetGpuDeviceDriverLookupFunction = _libSdl
      .lookupFunction<
        Pointer<Utf8> Function(Pointer<SdlGpuDevice> device),
        Pointer<Utf8> Function(Pointer<SdlGpuDevice> device)
      >('SDL_GetGPUDeviceDriver');
  final result = sdlGetGpuDeviceDriverLookupFunction(device);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}