Home

Core

SDL core operations

Operations

ClearError

Clear any previous error message

function : public : ClearError() ~ Nil

GLExtensionSupported

Check if an OpenGL extension is supported for the current context

function : public : GLExtensionSupported(extension:String) ~ Bool
Parameters
NameTypeDescription
extensionStringthe name of the extension to check

Return
TypeDescription
Booltrue if the extension is supported, false otherwise

GLGetAttribute

Get the actual value for an attribute from the current context

function : public : GLGetAttribute(attr:GLattr, value:IntHolder) ~ Int
Parameters
NameTypeDescription
attrGLattrthe SDL_GLattr structure to query
valueIntHolderpointer filled in with the current value of attr

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

GLGetCurrentWindow

Get the currently active OpenGL window

function : public : GLGetCurrentWindow() ~ Window
Return
TypeDescription
Windowactive window

GLGetSwapInterval

Get the swap interval for the current OpenGL context

function : public : GLGetSwapInterval() ~ Int
Return
TypeDescription
Int0 if there is no vertical retrace synchronization, 1 if the buffer swap is synchronized with the vertical retrace, and -1 if late swaps happen immediately instead of waiting for the next retrace;

GLLoadLibrary

dynamically load an OpenGL library

function : public : GLLoadLibrary(path:String) ~ Int
Parameters
NameTypeDescription
pathStringthe platform dependent OpenGL library name, or Nil to open the default OpenGL library

GLResetAttributes

Reset all previously set OpenGL context attributes to their default values

function : public : GLResetAttributes() ~ Nil

GLSetAttribute

Set an OpenGL window attribute before window creation

function : public : GLSetAttribute(attr:GLattr, value:Int) ~ Int
Parameters
NameTypeDescription
attrGLattrthe OpenGL attribute to set; see Remarks for details
valueIntthe desired value for the attribute

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

GLSetSwapInterval

Set the swap interval for the current OpenGL context

function : public : GLSetSwapInterval(interval:Int) ~ Int
Parameters
NameTypeDescription
intervalInt0 for immediate updates, 1 for updates synchronized with the vertical retrace, -1 for adaptive vsync

Return
TypeDescription
Int0 on success or -1 if setting the swap interval is not supported

GLUnloadLibrary

Unload the OpenGL library previously loaded

function : public : GLUnloadLibrary() ~ Nil

GetError

Retrieve a message about the last error that occurred

function : public : GetError() ~ String
Return
TypeDescription
Stringmessage with information about the specific error that occurred

Init

Initialize the SDL library. This must be called before using most other SDL functions.

function : public : Init(flags:Int) ~ Int
Parameters
NameTypeDescription
flagsIntsubsystem initialization flags

InitSubSystem

Initialize specific SDL subsystems

function : public : InitSubSystem(flags:Int) ~ Int
Parameters
NameTypeDescription
flagsIntsubsystem initialization flags

Quit

Clean up all initialized subsystems. You should call it upon all exit conditions.

function : public : Quit() ~ Nil

QuitSubSystem

Shut down specific SDL subsystems.

function : public : QuitSubSystem(flags:Int) ~ Nil
Parameters
NameTypeDescription
flagsIntsubsystem initialization flags

WasInit

Mask of the specified subsystems which have previously been initialized

function : public : WasInit(flags:Int) ~ Int
Parameters
NameTypeDescription
flagsIntsubsystem initialization flags