All Bundles

Display

Video display

Operations

GetClosestDisplayMode

Get the closest match to the requested display mode

function : GetClosestDisplayMode(displayIndex:Int, mode:DisplayMode, closest:DisplayMode) ~ Bool
Parameters
NameTypeDescription
displayIndexIntthe index of the display to query
modeDisplayModean SDL_DisplayMode structure containing the desired display mode
closestDisplayModean SDL_DisplayMode structure filled in with the closest match of the available display modes

Return
TypeDescription
Booltrue of success, false otherwise

GetCurrentDisplayMode

Get information about the current display mode

function : GetCurrentDisplayMode(displayIndex:Int, mode:DisplayMode) ~ Int
Parameters
NameTypeDescription
displayIndexIntthe index of the display to query
modeDisplayModean DisplayMode class filled in with the current display mode

Return
TypeDescription
IntReturns 0 on success or a negative error code on failure

GetCurrentVideoDriver

Name of the currently initialized video driver

function : GetCurrentVideoDriver() ~ String
Return
TypeDescription
Stringname of the current video driver

GetDPI

Get the dots/pixels-per-inch for a display

function : GetDPI(index:Int, ddpi:FloatRef, hdpi:FloatRef, vdpi:FloatRef) ~ Int
Parameters
NameTypeDescription
indexIntindex of the display from which DPI information should be queried
ddpiFloatRefpointer filled in with the diagonal DPI of the display; may be NULL
hdpiFloatRefpointer filled in with the horizontal DPI of the display; may be NULL
vdpiFloatRefpointer filled in with the vertical DPI of the display; may be NULL

Return
TypeDescription
Int0 on success or a negative error code on failure

GetDisplayBounds

Get the desktop area represented by a display, with the primary display located at 0,0

function : GetDisplayBounds(displayIndex:Int, rect:Rect) ~ Int
Parameters
NameTypeDescription
displayIndexIntthe index of the display to query
rectRectthe SDL_Rect structure filled in with the display bounds

Return
TypeDescription
Int0 on success or a negative error code on failure

GetDisplayMode

Get information about a specific display mode

function : GetDisplayMode(displayIndex:Int, modeIndex:Int, mode:DisplayMode) ~ Int
Parameters
NameTypeDescription
displayIndexIntthe index of the display to query
modeIndexIntthe index of the display mode to query
modeDisplayModean DisplayMode class filled in with the mode at modeIndex

Return
TypeDescription
IntReturns 0 on success or a negative error code on failure

GetDisplayName

Get the name of a display in UTF-8 encoding

function : GetDisplayName(displayIndex:Int) ~ String
Parameters
NameTypeDescription
displayIndexIntthe index of display from which the name should be queried

Return
TypeDescription
Stringthe name of a display

GetNumDisplayModes

Get the number of available display modes

function : GetNumDisplayModes(displayIndex:Int) ~ Int
Parameters
NameTypeDescription
displayIndexIntthe index of the display to query

Return
TypeDescription
Intnumber >= 1 on success or a negative error code on failure

GetNumVideoDisplays

Get the number of available video displays

function : GetNumVideoDisplays() ~ Int
Return
TypeDescription
Intnumber >= 1 or a negative error code on failure

GetNumVideoDrivers

Get the number of video drivers compiled into SDL

function : GetNumVideoDrivers() ~ Int
Return
TypeDescription
Intnumber >= 1 on success or a negative error code on failure

GetVideoDriver

Get the name of a built in video driver

function : GetVideoDriver(index:Int) ~ String
Parameters
NameTypeDescription
indexIntthe index of a video driver

Return
TypeDescription
Stringname of the video driver with the given index

VideoInit

Initialize the video subsystem, optionally specifying a video driver

function : VideoInit(driver_name:String) ~ Int
Parameters
NameTypeDescription
driver_nameStringname of a video driver to initialize, or Nil for the default driver

Return
TypeDescription
Int0 on success or a negative error code on failure

VideoQuit

Shut down the video subsystem

function : VideoQuit() ~ Nil