sdlGetVideoDriver function

String? sdlGetVideoDriver(
  1. int index
)

Get the name of a built in video driver.

The video drivers are presented in the order in which they are normally checked during initialization.

\param index the index of a video driver \returns the name of the video driver with the given index.

\since This function is available since SDL 2.0.0.

\sa SDL_GetNumVideoDrivers

extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index)

Implementation

String? sdlGetVideoDriver(int index) {
  final sdlGetVideoDriverLookupFunction = libSdl2.lookupFunction<
      Pointer<Utf8> Function(Int32 index),
      Pointer<Utf8> Function(int index)>('SDL_GetVideoDriver');
  final result = sdlGetVideoDriverLookupFunction(index);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}