Previous: , Up: API Conventions   [Index]


2.2 Functions

The low-level bindings currently use names identical to their C API counterparts.

High-level bindings adopt names that are closer to natural language, and a more common style for Scheme:

Some function names are altered in additional ways, to make clear which object is being operated on. Functions that mutate objects or state will have their name prefixed with set-, such as set-matrix-mode.

FIXME: This choice may be too unnatural for GL users.

Where the C API specifies multiple functions that perform a similar task on varying number and types of arguments, the high-level bindings provide a single function that takes optional arguments, and, where appropriate, using only the most natural type. Consider the group of C API functions including glVertex2f, glVertex3f, and so on; the high-level GL interface provides only a single function glVertex with optional arguments.

The high-level interfaces may differ in other ways, and it is important to refer to the specific documentation.

It is generally fine to intermix functions from corresponding low-level and high-level bindings. This can be useful if you know the specific type of data you are working with and want to avoid the overhead of dynamic dispatch at runtime. Any cases where such intermixing causes problems will be noted in the documentation for the high-level bindings.