You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This code is based on David Turnbull's fiendishly clever SGLOpenGL; I can't take any credit for any of the smart stuff going on here, all I did was make it work with Swift 3 and made the code-generation scripts compatible with Linux.
You can't use OpenGL until you can call its functions. This OpenGL loader
imports all the functions up to OpenGL 4.5. Platform differences are abstracted
away. There's nothing to initialize and no C code. 100% easy. 100% Swift.
If you've used OpenGL in Swift before you probably used commands like this.
You have to cast everything. Not fun. This is a result of how Swift translates C header files.
Because this library is specialized for Swift, all that casting is a thing of the past.
Every OpenGL command is also available with argument labels. This may make your
code easier to read. It also makes it difficult to put values in the wrong
position and sometimes catches copy-and-paste mistakes.
This library provides you with direct calls to the OpenGL functions. There's
no translation layer required to provide the syntactical sugar. Because Swift has first-class
support for working with C, there's no performance penalty for crossing languages.
API
All OpenGL functions are available.
In addition, there are a couple of helper functions for dealing with shader source code: