Up: Introduction [Index]
Guile-OpenGL uses the dynamic foreign function interface provided by Guile 2.0, providing access to OpenGL without any C code at all. In fact, much of Guile-OpenGL (and this manual) is automatically generated from upstream API specifications and documentation.
We have tried to do a very complete job at wrapping OpenGL, and additionally have tried to provide a nice Scheme interface as well. Our strategy has been to separate the binding into low-level and high-level pieces.
The low-level bindings correspond exactly with the OpenGL specification,
and are well-documented. However, these interfaces are not so nice to
use from Scheme; output arguments have to be allocated by the caller,
and there is only the most basic level of type checking, and no sanity
checking at all. For example, you can pass a bytevector of image data
to the low-level glTexImage2D
procedure, but no check is made
that the dimensions you specify actually correspond to the size of the
bytevector. This function could end up reading past the end of the
bytevector. Worse things can happen with procedures that write to
arrays, like glGetTexImage
.
The high-level bindings are currently a work in progress, and are being manually written. They intend to be a complete interface to the OpenGL API, without the need to use the low-level bindings. However, the low-level bindings will always be available for you to use if needed, and have the advantage that their behavior is better documented and specified by OpenGL itself.
Low-level bindings are accessed by loading the (module
low-level)
, for example via:
(use-modules (gl low-level))
The high-level modules are named like (module)
, for
example (gl)
.
Up: Introduction [Index]