SDL core operations
OperationsClear any previous error message
function : ClearError() ~ Nil
Check if an OpenGL extension is supported for the current context
function : GLExtensionSupported(extension:String) ~ Bool
Name | Type | Description |
---|---|---|
extension | String | the name of the extension to check |
Type | Description |
---|---|
Bool | true if the extension is supported, false otherwise |
Get the actual value for an attribute from the current context
function : GLGetAttribute(attr:GLattr, value:IntRef) ~ Int
Name | Type | Description |
---|---|---|
attr | GLattr | the SDL_GLattr structure to query |
value | IntRef | pointer filled in with the current value of attr |
Type | Description |
---|---|
Int | 0 on success or a negative error code on failure |
Get the currently active OpenGL window
function : GLGetCurrentWindow() ~ Window
Type | Description |
---|---|
Window | active window |
Get the swap interval for the current OpenGL context
function : GLGetSwapInterval() ~ Int
Type | Description |
---|---|
Int | 0 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; |
dynamically load an OpenGL library
function : GLLoadLibrary(path:String) ~ Int
Name | Type | Description |
---|---|---|
path | String | the platform dependent OpenGL library name, or Nil to open the default OpenGL library |
Reset all previously set OpenGL context attributes to their default values
function : GLResetAttributes() ~ Nil
Set an OpenGL window attribute before window creation
function : GLSetAttribute(attr:GLattr, value:Int) ~ Int
Name | Type | Description |
---|---|---|
attr | GLattr | the OpenGL attribute to set; see Remarks for details |
value | Int | the desired value for the attribute |
Type | Description |
---|---|
Int | 0 on success or a negative error code on failure |
Set the swap interval for the current OpenGL context
function : GLSetSwapInterval(interval:Int) ~ Int
Name | Type | Description |
---|---|---|
interval | Int | 0 for immediate updates, 1 for updates synchronized with the vertical retrace, -1 for adaptive vsync |
Type | Description |
---|---|
Int | 0 on success or -1 if setting the swap interval is not supported |
Unload the OpenGL library previously loaded
function : GLUnloadLibrary() ~ Nil
Retrieve a message about the last error that occurred
function : GetError() ~ String
Type | Description |
---|---|
String | message with information about the specific error that occurred |
Initialize the SDL library. This must be called before using most other SDL functions.
function : Init(flags:Int) ~ Int
Name | Type | Description |
---|---|---|
flags | Int | subsystem initialization flags |
Initialize specific SDL subsystems
function : InitSubSystem(flags:Int) ~ Int
Name | Type | Description |
---|---|---|
flags | Int | subsystem initialization flags |
Clean up all initialized subsystems. You should call it upon all exit conditions.
function : Quit() ~ Nil
Shut down specific SDL subsystems.
function : QuitSubSystem(flags:Int) ~ Nil
Name | Type | Description |
---|---|---|
flags | Int | subsystem initialization flags |
Mask of the specified subsystems which have previously been initialized
function : WasInit(flags:Int) ~ Int
Name | Type | Description |
---|---|---|
flags | Int | subsystem initialization flags |