[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
GL doesn't define many data structures: some scalar primitives (e.g.
GLint
) and arrays of them.
For scalar values, Gauche-gl has natural mappings:
GLboolean
Scheme booleans.
GLbyte, GLubyte, GLshort, GLushort, GLint, GLuint, GLenum, GLbitfield
Scheme exact integers.
GLfloat, GLdouble, GLclampf, GLclampd
Scheme real numbers.
For arrays, Gauche-gl uses uniform (srfi-4) vector whenever possible.
For float arrays, however, Gauche-gl allows more structured types,
such as points or matrices, when they are relevant. Such types are provided
in gl.math3d
module (see Vectors and matrices),
which also provides common arithmetics between those types.
Another exception is an array of GLboolean—it doesn't have corresponding
uniform vector representation. Gauche-gl defines a new type,
<gl-boolean-vector>
, to represent an array of GLboolean.
See below for operations provided on it.
GLbyte[]
<s8vector>
GLubyte[]
<u8vector>
GLshort[]
<s16vector>
GLushort[]
<u16vector>
GLint[]
<s32vector>
GLuint[]
<u32vector>
GLfloat[], GLclampf[]
<f32vector>
, <point4f>
, <vector-4f>
,
<point4f-array>
, <vector4f-array>
,
<matrix4f>
, <quatf>
.
GLdouble[], GLclampd[]
<f64vector>
GLboolean[]
<gl-boolean-vector>
A class for an array of boolean values. You can pass its instance to the GL APIs that expect an array of GLbooleans. Its internal representation is bitwise compatible to GLbooean array, so passing it is quite efficient.
This class inherits <sequence>
, so you can use generic
sequence operations on it.
The external representation of GL boolean vector uses srfi-10 notation, and can be read back. For example, a GL boolean vector of length 5 may be written something like this:
#,(gl-boolean-vector #t #f #t #f #t) |
Returns a GL boolean vector of size elements. Elements are
initialized by either #f
or #t
, according to init.
(make-gl-boolean-vector 3 #t) ⇒ #,(gl-boolean-vector #t #t #t) |
Returns a GL boolean vector, whose elements are bool ….
(gl-boolean-vector #f #t #t) ⇒ #,(gl-boolean-vector #f #t #t) |
Returns #t
if obj is a GL boolean vector, #f
otherwise.
Returns length of a GL boolean vector v.
You can also use the sequence generic function size-of
.
Fills a GL boolean vector v with a boolean value bool.
Coerce list of boolean values to a GL boolean vector.
You can also use the coerce-to
generic function to convert
between GL boolean vectors and other sequences.
Returns k-th element of a GL boolean vector v. If k is out of range and fallback is provided, it is returned. If k is out of range and fallback is omitted, an error is signalled.
You can also use generic function ref
to access a
GL boolean vector.
Sets k-th element of a GL boolean vector v by a boolean value bool.
You can also use generic function (setter ref)
to modify a
GL boolean vector.
Returns a copy of a GL boolean vector v.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated by Shiro Kawai on June, 7 2008 using texi2html 1.78.