+SCM
+gacela_glClear (SCM mask)
+{
+ glClear (scm_to_int (mask));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glClearColor (SCM red, SCM green, SCM blue, SCM alpha)
+{
+ glClearColor (scm_to_double (red), scm_to_double (green), scm_to_double (blue), scm_to_double (alpha));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glClearDepth (SCM depth)
+{
+ glClearDepth (scm_to_double (depth));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glColor3f (SCM red, SCM green, SCM blue)
+{
+ glColor3f (scm_to_double (red), scm_to_double (green), scm_to_double (blue));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glColor4f (SCM red, SCM green, SCM blue, SCM alpha)
+{
+ glColor4f (scm_to_double (red), scm_to_double (green), scm_to_double (blue), scm_to_double (alpha));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glDepthFunc (SCM func)
+{
+ glDepthFunc (scm_to_int (func));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glEnable (SCM cap)
+{
+ glEnable (scm_to_int (cap));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glDisable (SCM cap)
+{
+ glDisable (scm_to_int (cap));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glEnd (void)
+{
+ glEnd ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glHint (SCM target, SCM mode)
+{
+ glHint (scm_to_int (target), scm_to_int (mode));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glLoadIdentity (void)
+{
+ glLoadIdentity ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glMatrixMode (SCM mode)
+{
+ glMatrixMode (scm_to_int (mode));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glRotatef (SCM angle, SCM x, SCM y, SCM z)
+{
+ glRotatef (scm_to_double (angle), scm_to_double (x), scm_to_double (y), scm_to_double (z));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glShadeModel (SCM mode)
+{
+ glShadeModel (scm_to_int (mode));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glTranslatef (SCM x, SCM y, SCM z)
+{
+ glTranslatef (scm_to_double (x), scm_to_double (y), scm_to_double (z));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glVertex2f (SCM x, SCM y)
+{
+ glVertex2f (scm_to_double (x), scm_to_double (y));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glVertex3f (SCM x, SCM y, SCM z)
+{
+ glVertex3f (scm_to_double (x), scm_to_double (y), scm_to_double (z));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glViewport (SCM x, SCM y, SCM width, SCM height)
+{
+ glViewport (scm_to_int (x), scm_to_int (y), scm_to_int (width), scm_to_int (height));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glGenTextures (SCM n)
+{
+ SCM textures;
+ int nint = scm_to_int (n);
+ GLuint text[nint];
+ int i;
+
+ textures = scm_list_n (SCM_UNDEFINED);
+ glGenTextures (nint, &text[0]);
+
+ for (i = nint - 1; i >= 0; i--) {
+ textures = scm_cons (scm_from_int (text[i]), textures);
+ }
+
+ return textures;
+}
+
+SCM
+gacela_glDeleteTextures (SCM n, SCM textures)
+{
+ int nint = scm_to_int (n);
+ GLuint text[nint];
+ int i;
+
+ for (i = 0; i < nint; i++) {
+ text[i] = scm_to_int (scm_list_ref (textures, scm_from_int (i)));
+ }
+
+ glDeleteTextures (nint, &text[0]);
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glBindTexture (SCM target, SCM texture)
+{
+ glBindTexture (scm_to_int (target), scm_to_int (texture));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glTexImage2D (SCM target, SCM level, SCM internalFormat, SCM width, SCM height, SCM border, SCM format, SCM type, SCM pixels)
+{
+ glTexImage2D (scm_to_int (target), scm_to_int (level), scm_to_int (internalFormat), scm_to_int (width), \
+ scm_to_int (height), scm_to_int (border), scm_to_int (format), scm_to_int (type), \
+ (GLvoid *)scm_to_int (pixels));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glTexParameteri (SCM target, SCM pname, SCM param)
+{
+ glTexParameteri (scm_to_int (target), scm_to_int (pname), scm_to_int (param));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glTexCoord2f (SCM s, SCM t)
+{
+ glTexCoord2f (scm_to_double (s), scm_to_double (t));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glLightfv (SCM light, SCM pname, SCM params)
+{
+ int n = scm_to_int (scm_length (params));
+ GLfloat gl_params[n];
+ int i;
+
+ for (i = 0; i < n; i++) {
+ gl_params[i] = scm_to_double (scm_list_ref (params, scm_from_int (i)));
+ }
+
+ glLightfv (scm_to_int (light), scm_to_int (pname), gl_params);
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glNormal3f (SCM nx, SCM ny, SCM nz)
+{
+ glNormal3f (scm_to_double (nx), scm_to_double (ny), scm_to_double (nz));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glBlendFunc (SCM sfactor, SCM dfactor)
+{
+ glBlendFunc (scm_to_int (sfactor), scm_to_int (dfactor));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glOrtho (SCM left, SCM right, SCM bottom, SCM top, SCM near_val, SCM far_val)
+{
+ glOrtho (scm_to_double (left), scm_to_double (right), scm_to_double (bottom), scm_to_double (top), \
+ scm_to_double (near_val), scm_to_double (far_val));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glPushMatrix (void)
+{
+ glPushMatrix ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_glPopMatrix (void)
+{
+ glPopMatrix ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_gluPerspective (SCM fovy, SCM aspect, SCM zNear, SCM zFar)
+{
+ gluPerspective (scm_to_double (fovy), scm_to_double (aspect), scm_to_double (zNear), scm_to_double (zFar));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_gluBuild2DMipmaps (SCM target, SCM internalFormat, SCM width, SCM height, SCM format, SCM type, SCM data)
+{
+ return scm_from_int (gluBuild2DMipmaps (scm_to_int (target), scm_to_int (internalFormat), scm_to_int (width), \
+ scm_to_int (height), scm_to_int (format), scm_to_int (type), \
+ (void *)scm_to_int (data)));
+}
+
+SCM
+gacela_gluLookAt (SCM eyeX, SCM eyeY, SCM eyeZ, SCM centerX, SCM centerY, SCM centerZ, SCM upX, SCM upY, SCM upZ)
+{
+ gluLookAt (scm_to_double (eyeX), scm_to_double (eyeY), scm_to_double (eyeZ), \
+ scm_to_double (centerX), scm_to_double (centerY), scm_to_double (centerZ), \
+ scm_to_double (upX), scm_to_double (upY), scm_to_double (upZ));
+ return SCM_UNSPECIFIED;
+}
+