sdlGetDisplayName function

String? sdlGetDisplayName(
  1. int displayIndex
)

Get the name of a display in UTF-8 encoding.

\param displayIndex the index of display from which the name should be queried \returns the name of a display or NULL for an invalid display index or failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_GetNumVideoDisplays

extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex)

Implementation

String? sdlGetDisplayName(int displayIndex) {
  final sdlGetDisplayNameLookupFunction = libSdl2.lookupFunction<
      Pointer<Utf8> Function(Int32 displayIndex),
      Pointer<Utf8> Function(int displayIndex)>('SDL_GetDisplayName');
  final result = sdlGetDisplayNameLookupFunction(displayIndex);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}