Read Me
This is Gauche-gl, OpenGL binding for Gauche.
See INSTALL (English) or INSTALL.eucjp (Japanese) for installation
instructions.
No document is written yet. There are several examples ported from
``OpenGL Programming Guide'' under examples/glbook.
The mapping from Scheme to C call is mostly straightforward.
SRFI-4 uniform vectors are extensively used to represent
arrays of numbers; e.g. when you can pass GLfloat array to
C call, you can pass f32vector in Scheme.
Scheme API is polymorphic. It can figure out what type of
arguments you pass to it. The variations functions for
argument types in C calls (e.g. glVertexi, glVertexfv, etc)
are all mapped to a single gl-vertex function.
(gl-vertex 1.0 2.0 3.0) => glVertex3d
(gl-vertex '#f32(1.0 2.0)) => glVertex2fv
(gl-vertex '#s32(3 2 5)) => glVertex3iv
Generally passing uniform vectors is more efficient, for
it doesn't need to check type of every values in it.
Among variations of uniform vectors, f32vector is usually
the most efficient.
Variables GL_VERSION_1_1, GL_VERSION_1_2 and GL_VERSION_1_3
may be defined and bound to #t if the platform on which
Gauche-gl is compiled supports OpenGL version 1.1, 1.2 or
1.3, respectively. You can use symbol-bound? to check these
variables are bound. You can also use symbol-bound? to
check the existence of extensions, such as GL_ARB_multitexture.