The functions in sgl use Scheme style names instead of C style names. To convert a C OpenGL name to a Scheme OpenGL name, change the gl prefix to gl-, separate adjacent words with hyphens, and convert to all lower case. Functions that have several variants to accommodate different numbers and types of arguments are collapsed into one or two functions in sgl. For example, sgl provides two vertex functions: vertex and vertex-v. The vertex function accepts 2, 3 or 4 numerical arguments, and the vertex-v function accepts gl-vectors of length 2, 3 or 4. The C language OpenGL interface, in contrast, has 24 vertex functions: glVertex3i, glVertex4fv, etc.
Functions in sgl take symbols instead of integers for GLenum arguments. Each function checks that the given symbol is an acceptable argument and raises an exception if it is not. Given the name of a C-language #define constant, determine the corresponding symbolic argument by removing the leading GL_, converting the letters to lower-case and replacing each _ with -. For example, GL_TRIANGLES becomes 'triangles, and GL_TRIANGLE_STRIP becomes 'triangle-strip. Additionally, the functions check the length of any array arguments to ensure that OpenGL does not attempt to write or read after the array.
|(struct gl-selection-record (min-z max-z stack))|
|min-z : real?|
|max-z : real?|
|stack : ....|
Represents a selection.
Scheme-style variants of the OpenGL functions.
|(gl-process-selection vec hits) → (listof gl-selection-record?)|
|vec : gl-uint-vector?|
|hits : exact-nonnegative-integer?|
|(gl-get-gl-version-number) → exact-nonnegative-integer?|
Returns the run-time OpenGL version number as an integer: 10, 11, 12, 13, 14, 15, or 20.
|(gl-get-glu-version-number) → exact-nonnegative-integer?|
Returns the run-time GLU version number as an integer: 10, 11, 12, or 13.