sdlCreateWindowFrom function

Pointer<SdlWindow> sdlCreateWindowFrom(
  1. Pointer<NativeType> data
)

Create an SDL window from an existing native window.

In some cases (e.g. OpenGL) and on some platforms (e.g. Microsoft Windows) the hint SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT needs to be configured before using SDL_CreateWindowFrom().

\param data a pointer to driver-dependent window creation data, typically your native window cast to a void* \returns the window that was created or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

\sa SDL_CreateWindow \sa SDL_DestroyWindow

extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data)

Implementation

Pointer<SdlWindow> sdlCreateWindowFrom(Pointer<NativeType> data) {
  final sdlCreateWindowFromLookupFunction = libSdl2.lookupFunction<
      Pointer<SdlWindow> Function(Pointer<NativeType> data),
      Pointer<SdlWindow> Function(
          Pointer<NativeType> data)>('SDL_CreateWindowFrom');
  return sdlCreateWindowFromLookupFunction(data);
}