sdl2 :: SDLWindow :: defaultinit
# A window created by SDL
extern class SDLWindow `{ SDL_Window * `}
# Create a window with the given `title`, `width` and `height`, also apply the `flags`
new (title: CString, width, height: Int, flags: SDLWindowFlags) `{
return SDL_CreateWindow(title,
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
width, height, flags);
`}
# Has this window been correctly initialized?
fun initialized: Bool do return not address_is_null
# Destroy this window
fun destroy `{ SDL_DestroyWindow(self); `}
# Get the `SDLWindowFlags` describing the status of the window
fun flags: SDLWindowFlags `{ return SDL_GetWindowFlags(self); `}
# Show a simple message box
#
# Similar to `sys.sdl.show_simple_message_box` but attached to this window
fun show_simple_message_box(level: SDLMessageBoxFlags, title, content: CString) `{
SDL_ShowSimpleMessageBox(level, title, content, self);
`}
# Set the icon of this window
fun icon=(icon: SDLSurface) `{ SDL_SetWindowIcon(self, icon); `}
end
lib/sdl2/sdl2_base.nit:139,1--166,3