sdlGetCurrentVideoDriver function

String? sdlGetCurrentVideoDriver()

Get the name of the currently initialized video driver.

The names of drivers are all simple, low-ASCII identifiers, like "cocoa", "x11" or "windows". These never have Unicode characters, and are not meant to be proper names.

\returns the name of the current video driver or NULL if no driver has been initialized.

\threadsafety This function should only be called on the main thread.

\since This function is available since SDL 3.1.3.

\sa SDL_GetNumVideoDrivers \sa SDL_GetVideoDriver

extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentVideoDriver(void)

Implementation

String? sdlGetCurrentVideoDriver() {
  final sdlGetCurrentVideoDriverLookupFunction = libSdl3.lookupFunction<
      Pointer<Utf8> Function(),
      Pointer<Utf8> Function()>('SDL_GetCurrentVideoDriver');
  final result = sdlGetCurrentVideoDriverLookupFunction();
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}