Core
SDL core operations
Operations
- ClearError
- GLExtensionSupported
- GLGetAttribute
- GLGetCurrentWindow
- GLGetSwapInterval
- GLGetVersionString
- GLLoadLibrary
- GLResetAttributes
- GLSetAttribute
- GLSetSwapInterval
- GLUnloadLibrary
- GetError
- Init
- InitSubSystem
- Quit
- QuitSubSystem
- WasInit
GLExtensionSupported # function
Check if an OpenGL extension is supported for the current context
function : GLExtensionSupported(extension:String) ~ BoolParameters
| Name | Type | Description |
|---|---|---|
| extension | String | the name of the extension to check |
Return
| Type | Description |
|---|---|
| Bool | true if the extension is supported, false otherwise |
GLGetAttribute # function
Get the actual value for an attribute from the current context
function : GLGetAttribute(attr:GLattr, value:IntRef) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| attr | GLattr | the SDL_GLattr structure to query |
| value | IntRef | pointer filled in with the current value of attr |
Return
| Type | Description |
|---|---|
| Int | 0 on success or a negative error code on failure |
GLGetCurrentWindow # function
Get the currently active OpenGL window
function : GLGetCurrentWindow() ~ WindowReturn
| Type | Description |
|---|---|
| Window | active window |
GLGetSwapInterval # function
Get the swap interval for the current OpenGL context
function : GLGetSwapInterval() ~ IntReturn
| 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; |
GLGetVersionString # function
The GL_VERSION string of the current OpenGL context, e.g. "3.3.0 NVIDIA 560.94". Returns an empty string when no context is current. Worth checking right after GLCreateContext rather than trusting the attributes you asked for: a driver may hand back a different version than requested, and on macOS you silently get a legacy 2.1 context unless a core + forward-compatible profile was set before the window was created. Finding that out here is far cheaper than finding out at the first shader compile.
function : GLGetVersionString() ~ StringReturn
| Type | Description |
|---|---|
| String | the GL version string, or "" if no context is current |
GLLoadLibrary # function
dynamically load an OpenGL library
function : GLLoadLibrary(path:String) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| path | String | the platform dependent OpenGL library name, or Nil to open the default OpenGL library |
GLResetAttributes # function
Reset all previously set OpenGL context attributes to their default values
function : GLResetAttributes() ~ NilGLSetAttribute # function
Set an OpenGL window attribute before window creation
function : GLSetAttribute(attr:GLattr, value:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| attr | GLattr | the OpenGL attribute to set; see Remarks for details |
| value | Int | the desired value for the attribute |
Return
| Type | Description |
|---|---|
| Int | 0 on success or a negative error code on failure |
GLSetSwapInterval # function
Set the swap interval for the current OpenGL context
function : GLSetSwapInterval(interval:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| interval | Int | 0 for immediate updates, 1 for updates synchronized with the vertical retrace, -1 for adaptive vsync |
Return
| Type | Description |
|---|---|
| Int | 0 on success or -1 if setting the swap interval is not supported |
GLUnloadLibrary # function
Unload the OpenGL library previously loaded
function : GLUnloadLibrary() ~ NilGetError # function
Retrieve a message about the last error that occurred
function : GetError() ~ StringReturn
| Type | Description |
|---|---|
| String | message with information about the specific error that occurred |
Init # function
Initialize the SDL library. This must be called before using most other SDL functions.
function : Init(flags:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| flags | Int | subsystem initialization flags |
InitSubSystem # function
Initialize specific SDL subsystems
function : InitSubSystem(flags:Int) ~ IntParameters
| Name | Type | Description |
|---|---|---|
| flags | Int | subsystem initialization flags |
Quit # function
Clean up all initialized subsystems. You should call it upon all exit conditions.
function : Quit() ~ Nil