22Utility functions for homogenous vectorsπ i
These functions are not part of the OpenGL API but are provided to make
working with glVertexPointer and similar procedures easier.
Returns #t iff v satisfies either
gl-vector?, cpointer? or exact-nonnegative-integer?.
This defines a very liberal "pointer-to-anything" type.
Typically, OpenGL procedures which accept gl-pointer? have additional requirements
based on the context. In other words, the fact that the contract suggests that they accept such
a wide range of values doesn’t mean that in any particular context all values are legal.
Return #t iff v is one of the constants
GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT,
GL_UNSIGNED_INT, GL_INT,
GL_FLOAT, or GL_DOUBLE.
( gl-vector->typev)→gl-type?
v:gl-vector?
Determine the OpenGL type of v.
This returns a numerical value such as GL_SHORT, GL_FLOAT, etc., which
can be passed into glVertexPointer and similar procedures.
( gl-vector->cpointerv)→cpointer?
v:gl-vector?
Get a C pointer to v.
( gl-vector->lengthv)→exact-nonnegative-integer?
v:gl-vector?
Get the length of v.
( gl-vector->type/cpointerv) →
gl-type? cpointer?
v:gl-vector?
Get the OpenGL type and C pointer of v.
This is slightly more efficient than getting them each individually.
( gl-vector->type/cpointer/lengthv)
→
gl-type?
cpointer?
exact-nonnegative-integer?
v:gl-vector?
Get the OpenGL type, C pointer and length of v.
This is slightly more efficient than getting them each individually.
( gl-vector-sizeofv)→exact-nonnegative-integer?
v:gl-vector?
Get the length of v in bytes.
( gl-vector-alignofv)→exact-nonnegative-integer?
v:gl-vector?
Get the alignment requirement of v.
( gl-type->ctypetype)→ctype?
type:gl-type?
Get the C type associated with the given OpenGL type.
( gl-type-sizeoftype)→exact-nonnegative-integer?
type:gl-type?
Get the length in bytes of values of type type.
( gl-type-alignoftype)→exact-nonnegative-integer?
type:gl-type?
Get the alignment requirement of values of type type.