sdlCreateShapedWindow function
Create a window that can be shaped with the specified position, dimensions, and flags.
\param title The title of the window, in UTF-8 encoding. \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or ::SDL_WINDOWPOS_UNDEFINED. \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or ::SDL_WINDOWPOS_UNDEFINED. \param w The width of the window. \param h The height of the window. \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. \return the window created, or NULL if window creation failed.
\since This function is available since SDL 2.0.0.
\sa SDL_DestroyWindow
extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags)
Implementation
Pointer<SdlWindow> sdlCreateShapedWindow(
String? title, int x, int y, int w, int h, int flags) {
final sdlCreateShapedWindowLookupFunction = libSdl2.lookupFunction<
Pointer<SdlWindow> Function(Pointer<Utf8> title, Uint32 x, Uint32 y,
Uint32 w, Uint32 h, Uint32 flags),
Pointer<SdlWindow> Function(Pointer<Utf8> title, int x, int y, int w,
int h, int flags)>('SDL_CreateShapedWindow');
final titlePointer = title != null ? title.toNativeUtf8() : nullptr;
final result =
sdlCreateShapedWindowLookupFunction(titlePointer, x, y, w, h, flags);
calloc.free(titlePointer);
return result;
}