On this page:
top
up

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.

procedure

( gl-vector?v)boolean?

v:any/c
Returns #t if v belongs to one of the homogenous vector types which can be used with OpenGL, #f otherwise. These vector types are: u8vector , s8vector , u16vector , s16vector , u32vector , s32vector , f32vector and f64vector .

procedure

( gl-pointer?v)boolean?

v:any/c
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.

procedure

( gl-type?v)boolean?

v:any/c
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.

procedure

( 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.

procedure

( gl-vector->cpointerv)cpointer?

v:gl-vector?
Get a C pointer to v.

procedure

( gl-vector->lengthv)exact-nonnegative-integer?

v:gl-vector?
Get the length of v.

procedure

( 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.

procedure

( 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.

procedure

( gl-vector-sizeofv)exact-nonnegative-integer?

v:gl-vector?
Get the length of v in bytes.

procedure

( gl-vector-alignofv)exact-nonnegative-integer?

v:gl-vector?
Get the alignment requirement of v.

procedure

( gl-type->ctypetype)ctype?

type:gl-type?
Get the C type associated with the given OpenGL type.

procedure

( gl-type-sizeoftype)exact-nonnegative-integer?

type:gl-type?
Get the length in bytes of values of type type.

procedure

( gl-type-alignoftype)exact-nonnegative-integer?

type:gl-type?
Get the alignment requirement of values of type type.

top
up

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /