sdlGetWindowTitle function

String? sdlGetWindowTitle(
  1. Pointer<SdlWindow> window
)

Get the title of a window.

\param window the window to query \returns the title of the window in UTF-8 format or "" if there is no title.

\since This function is available since SDL 2.0.0.

\sa SDL_SetWindowTitle

extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window)

Implementation

String? sdlGetWindowTitle(Pointer<SdlWindow> window) {
  final sdlGetWindowTitleLookupFunction = libSdl2.lookupFunction<
      Pointer<Utf8> Function(Pointer<SdlWindow> window),
      Pointer<Utf8> Function(Pointer<SdlWindow> window)>('SDL_GetWindowTitle');
  final result = sdlGetWindowTitleLookupFunction(window);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}