[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 GL state control

Capabilities

Function: gl-enable cap
Function: gl-disable cap

Turns on and off a capability cap. Check out OpenGL reference for the list of capabilities.

Function: gl-is-enabled cap

Returns #t of #f depending on cap is enabled or not.

Function: gl-enable-client-state array
Function: gl-disable-client-state array

Enable/disable a client-side array (e.g. vertex array) specified by array. Array can be one of the following constants.

GL_VERTEX_ARRAY
GL_COLOR_ARRAY
GL_INDEX_ARRAY
GL_NORMAL_ARRAY
GL_TEXTURE_COORD_ARRAY
GL_EDGE_FLAG_ARRAY

State values

Gauche has two variations for each type of OpenGL glGetTYPE APIs; nondestructive version and destructive versions. Nondestructive versions such as gl-get-boolean allocates and returns the vector of appropriate type for the state. For destructive versions such as gl-get-boolean!, you need to pass a vector to be filled in.

The destructive version is non-allocating operation, so it is suitable if you call it within the drawing loop.

If the state has a scalar value, the non-destructive version of query function returns a scalar value, but you need to pass a (uniform) vector of length 1 for the destructive version.

Function: gl-state-vector-size state

[Gauche specific] Returns the required size of the vector to retrieve GL state state. It is useful to prepare the vector to pass to the destructive version of glGetTYPE API.

Function: gl-get-boolean state
Function: gl-get-boolean! gl-boolean-vector state

Get (a) boolean state value(s).

Function: gl-get-integer state
Function: gl-get-integer! s32vector state

Get (an) integer state value(s).

Function: gl-get-float state
Function: gl-get-float! f32vector state

Get (a) single-precision floating-point state value(s).

Function: gl-get-double state
Function: gl-get-double! f64vector state

Get (a) double-precision floating-point state value(s).

Push/pop attributes

Function: gl-push-attrib mask
Function: gl-pop-attrib

Push/pop attributes indicated by mask. Valid mask can be logior of the following bits (GLL_ALL_ATTRIB_BITS is logior of all the bits).

GL_ACCUM_BUFFER_BIT
GL_COLOR_BUFFER_BIT
GL_CURRENT_BIT
GL_DEPTH_BUFFER_BIT
GL_ENABLE_BIT
GL_EVAL_BIT
GL_FOG_BIT
GL_HINT_BIT
GL_LIGHTING_BIT
GL_LINE_BIT
GL_LIST_BIT
GL_PIXEL_MODE_BIT
GL_POINT_BIT
GL_POLYGON_BIT
GL_POLYGON_STIPPLE_BIT
GL_SCISSOR_BIT
GL_STENCIL_BUFFER_BIT
GL_TEXTURE_BIT
GL_TRANSFORM_BIT
GL_VIEWPORT_BIT
GL_ALL_ATTRIB_BITS

All of the above.

Function: gl-push-client-attrib mask
Function: gl-pop-client-attrib

Push/pop client attributes. Valid mask can be logior of the following

GL_CLIENT_PIXEL_STORE_BIT
GL_CLIENT_VERTEX_ARRAY_BIT
GL_ALL_CLIENT_ATTRIB_BITS

All of the above.

Other queries

Function: gl-get-error

Returns the value of the error flag. Returned an integer value. Check out the OpenGL documentation for the possible error values.

This function resets the error flag to GL_NO_ERROR.

Function: glu-error-string error-code

Returns a descriptive string for error-code returned by gl-get-error.

Function: gl-get-string name

Returns informative string about name of the GL library. Name can be one of the following.

GL_VENDOR
GL_RENDERER
GL_VERSION
GL_EXTENSIONS

To check a specific version or extension, you can also use the utility procedure gl-version>? etc. See GL feature checking.

Function: glu-get-string name

Returns informative string about name of the GLU library. Name can be one of the following.

GLU_VERSION
GLU_EXTENSIONS

Hints

Function: gl-hint target hint

Controls quality of target by hint. Target can be one of the following:

GL_POINT_SMOOTH_HINT
GL_LINE_SMOOTH_HINT
GL_POLYGON_SMOOTH_HINT
GL_FOG_HINT
GL_PERSPECTIVE_CORRECTION_HINT

And hint can be one of the following:

GL_FASTEST
GL_NICEST
GL_DONT_CARE

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by Shiro Kawai on June, 7 2008 using texi2html 1.78.