Open GL Super Bible

Previous Table of Contents Next


Reference Section

glDisable, glEnable

Purpose
Disables or enables an OpenGL feature.
Include File
<GL/gl.h>
Syntax
void glDisable(GLenum feature); glEnable
Description
glDisable disables an OpenGL drawing feature, and glEnable enables an OpenGL drawing feature.

Parameters

feature
GLenum: The feature to disable or enable, from Table 14-5.
Returns
None.
See Also
glIsEnabled, glPopAttrib, glPushAttrib
Table 14-5 Features Enabled/Disabled by glEnable/glDisable

Feature Description

GL_AUTO_NORMAL Automatically generate lighting normals from glMap parameters.
GL_COLOR_MATERIAL Assign material colors from the current drawing color.
GL_LIGHTING Enable lighting calculations.
GL_LIGHTx Enable lightx.
GL_MAP1_NORMAL Enable mapping of lighting normals from 1D coordinates.
GL_MAP2_NORMAL Enable mapping of lighting normals from 2D coordinates.
GL_NORMALIZE Normalize all lighting normals prior to doing calculations.
GL_MAP1_TEXTURE_COORD_1 The s texture coordinate will be generated by calls to glEvalPoint1, glEvalMesh1, and glEvalCoord1.
GL_MAP1_TEXTURE_COORD_2 The s and t texture coordinates will be generated by calls to glEvalPoint1, glEvalMesh1, and glEvalCoord1.
GL_MAP1_TEXTURE_COORD_3 The s, t, and r texture coordinates will be generated by calls to glEvalPoint1, glEvalMesh1, and glEvalCoord1.
GL_MAP1_TEXTURE_COORD_4 The s, t, r, and q texture coordinates will be generated by calls to glEvalPoint1, glEvalMesh1, and glEvalCoord1.
GL_MAP2_TEXTURE_COORD_1 The s texture coordinate will be generated by calls to glEvalPoint2, glEvalMesh2, and glEvalCoord2.
GL_MAP2_TEXTURE_COORD_2 The s and t texture coordinates will be generated by calls to glEvalPoint2, glEvalMesh2, and glEvalCoord2.
GL_MAP2_TEXTURE_COORD_3 The s, t, and r texture coordinates will be generated by calls to glEvalPoint2, glEvalMesh2, and glEvalCoord2.
GL_MAP2_TEXTURE_COORD_4 The s, t, r, and q texture coordinates will be generated by calls to glEvalPoint2, glEvalMesh2, and glEvalCoord2.
GL_TEXTURE_1D Enable 1D texturing unless 2D texturing is enabled.
GL_TEXTURE_2D Enable 2D texturing.
GL_TEXTURE_GEN_Q Automatically generate the q texture coordinate from calls to glVertex.
GL_TEXTURE_GEN_R Automatically generate the r texture coordinate from calls to glVertex.
GL_TEXTURE_GEN_S Automatically generate the s texture coordinate from calls to glVertex.
GL_TEXTURE_GEN_T Automatically generate the t texture coordinate from calls to glVertex.
GL_STENCIL_TEST Enable stencil buffer comparisons.
GL_DEPTH_TEST Enable depth buffer comparisons.
GL_ALPHA_TEST Do alpha value testing.
GL_BLEND Perform pixel blending operations.
GL_CLIP_PLANEx Clip drawing operations outside the specified clipping plane.
GL_CULL_FACE Cull back- or front-facing polygons.
GL_DITHER Dither color values.
GL_LINE_SMOOTH Anti-alias lines.
GL_LINE_STIPPLE Apply a bit pattern to lines.
GL_LOGIC_OP Do logical operations on pixels when drawing.
GL_POINT_SMOOTH Anti-alias points.
GL_POLYGON_SMOOTH Anti-alias polygons.
GL_POLYGON_STIPPLE Apply a bit pattern to polygons.
GL_SCISSOR_TEST Clip drawing outside the glScissor region.

glIsEnabled

Purpose
Tests if an OpenGL feature is enabled.
Include File
<GL/gl.h>
Syntax
GLboolean glIsEnabled(GLenum feature);
Description
This function returns GL_TRUE if the specified feature has been enabled and GL_FALSE otherwise.

Parameters

feature
GLenum: The feature to test (see glEnable).
Returns
GLboolean: GL_TRUE if the feature is enabled, GL_FALSE otherwise.
See Also
glDisable, glEnable, glPopAttrib, glPushAttrib

glPopAttrib

Purpose
Restores state information saved with glPushAttib.
Include File
<GL/gl.h>
Syntax
void glPopAttrib(void);
Description
glPopAttrib restores previously saved state information from a call to glPushAttrib. If the attribute stack is empty, the current OpenGL error state is set and the call is ignored.
Parameters
None.
Returns
None.
See Also
glDisable, glEnable, glIsEnabled, glPushAttrib

glPushAttrib

Purpose
Saves OpenGL state information.
Include File
<GL/gl.h>
Syntax
void glPushAttrib(GLuint bits);
Description
This function saves OpenGL state information specified by bits. If the attribute stack is full, the current OpenGL error state is set and the top of the stack is overwritten.

Parameters

bits
GLuint: The state information to save (see Table 14-1).
Returns
None.
See Also
glDisable, glEnable, glIsEnabled, glPopAttrib


Previous Table of Contents Next