SDL Window
OperationsCreates a window with the specified position, dimensions, and flags
New(title:String, x:Int, y:Int, w:Int, h:Int, flags:Int)
Name | Type | Description |
---|---|---|
title | String | the title of the window, in UTF-8 encoding |
x | Int | the x position of the window, WindowFlags->SDL_WINDOWPOS_CENTERED, or WindowFlags->SDL_WINDOWPOS_UNDEFINED |
y | Int | the y position of the window, WindowFlags->SDL_WINDOWPOS_CENTERED, or WindowFlags->SDL_WINDOWPOS_UNDEFINED |
w | Int | the width of the window, in screen coordinates |
h | Int | the height of the window, in screen coordinates |
flags | Int | 0, or one or more WindowFlags OR'd together |
Destroy a window
method : public : Destroy() ~ Nil
Prevent the screen from being blanked by a screen saver
function : DisableScreenSaver() ~ Nil
Allow the screen to be blanked by a screen saver
function : EnableScreenSaver() ~ Nil
Get the size of a window's underlying drawable in pixels (for use with glViewport).
method : public : GLGetDrawableSize(w:IntRef, h:IntRef) ~ Nil
Name | Type | Description |
---|---|---|
w | IntRef | a holder to variable for storing the width in pixels |
h | IntRef | a holder to variable for storing the height in pixels |
Update a window with OpenGL rendering.
method : public : GLSwap() ~ Nil
Gets the brightness (gamma multiplier) for the display that owns a given window
method : public : GetBrightness() ~ Float
Type | Description |
---|---|
Float | brightness for the display where 0.0 is completely dark and 1.0 is normal brightness |
Get the index of the display associated with a window
method : public : GetDisplayIndex() ~ Int
Type | Description |
---|---|
Int | index of the display containing the center of the window on success or a negative error code on failure |
Get the window flags
method : public : GetFlags() ~ Int
Type | Description |
---|---|
Int | OR'd mask of the SDL_WindowFlags associated with window |
Get the numeric ID of a window, for logging purposes
method : public : GetFromID(id:Int) ~ Window
Name | Type | Description |
---|---|---|
id | Int | window ID |
Type | Description |
---|---|
Window | the ID of the window on success or 0 on failure |
Gets the gamma ramp for the display that owns a given window
method : public : GetGammaRamp(red:IntRef, green:IntRef, blue:IntRef) ~ Int
Name | Type | Description |
---|---|---|
red | IntRef | a 256 element array of 16-bit quantities representing the translation table for the red channel |
green | IntRef | a 256 element array of 16-bit quantities representing the translation table for the green channel |
blue | IntRef | a 256 element array of 16-bit quantities representing the translation table for the blue channel, |
Type | Description |
---|---|
Int | 0 on success or a negative error code on failure |
Get a window's input grab mode
method : public : GetGrab() ~ Bool
Type | Description |
---|---|
Bool | Returns true if input is grabbed, false otherwise |
Get the window that currently has an input grab enabled
function : GetGrabbedWindow() ~ Window
Type | Description |
---|---|
Window | window if input is grabbed or NULL otherwise |
Get the numeric ID of a window, for logging purposes
method : public : GetID() ~ Int
Type | Description |
---|---|
Int | the ID of the window on success or 0 on failure |
Get the maximum size of a window's client area
method : public : GetMaximumSize(w:IntRef, h:IntRef) ~ Nil
Name | Type | Description |
---|---|---|
w | IntRef | pointer filled in with the maximum width of the window, |
h | IntRef | pointer filled in with the maximum height of the window |
Get the minimum size of a window's client area
method : public : GetMinimumSize(w:IntRef, h:IntRef) ~ Nil
Name | Type | Description |
---|---|---|
w | IntRef | pointer filled in with the minimum width of the window |
h | IntRef | pointer filled in with the minimum height of the window |
Get the pixel format associated with the window
method : public : GetPixelFormat() ~ Int
Type | Description |
---|---|
Int | pixel format of the window on success or SDL_PIXELFORMAT_UNKNOWN on failure |
Get the position of a window
method : public : GetPosition(x:IntRef, y:IntRef) ~ Nil
Name | Type | Description |
---|---|---|
x | IntRef | pointer filled in with the x position of the window, in screen coordinates |
y | IntRef | pointer filled in with the y position of the window, in screen coordinates |
Get the size of a window's client area
method : public : GetSize(w:IntRef, h:IntRef) ~ Nil
Name | Type | Description |
---|---|---|
w | IntRef | pointer filled in with the width of the window, in screen coordinates |
h | IntRef | pointer filled in with the height of the window, in screen coordinates |
Get the SDL surface associated with the window
method : public : GetSurface() ~ Surface
Type | Description |
---|---|
Surface | surface associated with the window, or NULL on failure |
Hide a window
method : public : Hide() ~ Nil
Determines if the underlying SDL C-struct is NULL
method : public : IsNull() ~ Bool
Type | Description |
---|---|
Bool | true if NULL, false otherwise |
Check whether the screensaver is currently enabled
function : IsScreenSaverEnabled() ~ Bool
Type | Description |
---|---|
Bool | Returns true if the screensaver is enabled, false if it is disabled |
Make a window as large as possible
method : public : Maximize() ~ Nil
Minimize a window to an iconic representation
method : public : Minimize() ~ Nil
Raise a window above other windows and set the input focus
method : public : Raise() ~ Nil
Restore the size and position of a minimized or maximized window
method : public : Restore() ~ Nil
Set the border state of a window
method : public : SetBordered(bordered:Bool) ~ Nil
Name | Type | Description |
---|---|---|
bordered | Bool | false to remove border, true to add border |
Sets the brightness (gamma multiplier) for the display that owns a given window
method : public : SetBrightness(brightness:Float) ~ Int
Name | Type | Description |
---|---|---|
brightness | Float | the brightness (gamma multiplier) value to set where 0.0 is completely dark and 1.0 is normal brightness |
Type | Description |
---|---|
Int | 0 on success or a negative error code on failure |
Set the display mode to use when a window is visible at full-screen
method : public : SetDisplayMode(mode:DisplayMode) ~ Int
Name | Type | Description |
---|---|---|
mode | DisplayMode | the SDL_DisplayMode structure representing the mode to use, or NULL to use the window's dimensions and the desktop's format and refresh rate |
Set a window's full-screen state
method : public : SetFullscreen(flags:Int) ~ Int
Name | Type | Description |
---|---|---|
flags | Int | WindowFlags->SDL_WINDOW_FULLSCREEN, WindowFlags->SDL_WINDOW_FULLSCREEN_DESKTOP or 0 |
Sets the gamma ramp for the display that owns a given window
method : public : SetGammaRamp(red:IntRef, green:IntRef, blue:IntRef) ~ Int
Name | Type | Description |
---|---|---|
red | IntRef | a 256 element array of 16-bit quantities representing the translation table for the red channel |
green | IntRef | a 256 element array of 16-bit quantities representing the translation table for the green channel |
blue | IntRef | a 256 element array of 16-bit quantities representing the translation table for the blue channel, |
Type | Description |
---|---|
Int | 0 on success or a negative error code on failure |
Set a window's input grab mode
method : public : SetGrab(grabbed:Bool) ~ Nil
Name | Type | Description |
---|---|---|
grabbed | Bool | true to grab input or false to release input |
Set the icon for a window
method : public : SetIcon(icon:Surface) ~ Nil
Name | Type | Description |
---|---|---|
icon | Surface | a Surface instance containing the icon for the window |
Set the maximum size of a window's client area
method : public : SetMaximumSize(max_w:Int, max_h:Int) ~ Nil
Name | Type | Description |
---|---|---|
max_w | Int | maximum width of the window in pixels |
max_h | Int | maximum height of the window in pixels |
Set the minimum size of a window's client area
method : public : SetMinimumSize(min_w:Int, min_h:Int) ~ Nil
Name | Type | Description |
---|---|---|
min_w | Int | the minimum width of the window in pixels |
min_h | Int | the minimum height of the window in pixels |
Set the position of a window
method : public : SetPosition(x:Int, y:Int) ~ Nil
Name | Type | Description |
---|---|---|
x | Int | the x coordinate of the window in screen coordinates, or WindowFlags->SDL_WINDOWPOS_CENTERED or WindowFlags->SDL_WINDOWPOS_UNDEFINED |
y | Int | the y coordinate of the window in screen coordinates, or WindowFlags->SDL_WINDOWPOS_CENTERED or WindowFlags->SDL_WINDOWPOS_UNDEFINED |
Set the size of a window's client area
method : public : SetSize(w:Int, h:Int) ~ Nil
Name | Type | Description |
---|---|---|
w | Int | width of the window in pixels, in screen coordinates, must be > 0 |
h | Int | height of the window in pixels, in screen coordinates, must be > 0 |
Set the title of a window
method : public : SetTitle(title:String) ~ Nil
Name | Type | Description |
---|---|---|
title | String | the desired window title in UTF-8 format |
Show a window
method : public : Show() ~ Nil
Display a simple modal message box
function : ShowSimpleMessageBox(flags:Int, title:String, message:String, window:Window) ~ Int
Name | Type | Description |
---|---|---|
flags | Int | an SDL_MessageBoxFlags value |
title | String | UTF-8 title text |
message | String | UTF-8 message text |
window | Window | the parent window, or NULL for no parent |
Type | Description |
---|---|
Int | 0 on success or a negative error code on failure |
Use this function to copy the window surface to the screen
method : public : UpdateSurface() ~ Int