sdlGetGpuDeviceDriver function

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

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

Implementation

String? sdlGetGpuDeviceDriver(Pointer<SdlGpuDevice> device) {
  final sdlGetGpuDeviceDriverLookupFunction = libSdl3.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();
}