OpenGL C Quick Reference

GLvoid glEnable( GL_LIGHTING )
GLvoid glDisable( GL_LIGHTING )

Turn lighting calculations on or off.


GLvoid glEnable( GL_LIGHT<n> )
GLvoid glDisable( GL_LIGHT<n> )

Enable or disable light source n.


GLvoid glLight[if]( GLenum light, GLenum pname, TYPE param )
GLvoid glLight[if]v( GLenum light, GLenum pname, TYPE *param )

Specify light source properties. light is GL_LIGHT<n>. pname is one of GL_SPOT_EXPONENT, GL_SPOT_CUTOFF, GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and GL_QUADRATIC_ATTENUATION.


GLvoid glEnable( GL_NORMALIZE )
GLvoid glDisable( GL_NORMALIZE )

Enable or disable automatic normalization of normal vectors.


GLvoid glNormal3[bsidf]( TYPE nx, TYPE ny, TYPE nz )
GLvoid glNormal3[bsidf]v( const TYPE *v )

Specify a normal vector, which becomes the normal for all successive vertices until the next call to glNormal3*(). Causes the color of each vertex to be computed if lighting is active.


GLvoid glMaterial[if]( GLenum face, GLenum pname, TYPE param )
GLvoid glMaterial[if]v( GLenum face, GLenum pname, TYPE *param )

Specify material reflection properties. face can be GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK. For glMaterial[if], pname must be GL_SHININESS. For glMaterial[if]v, pname can be GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS, GL_AMBIENT_AND_DIFFUSE, or GL_COLOR_INDEXES.


GLvoid glEnable( GL_COLOR_MATERIAL )
GLvoid glDisable( GL_COLOR_MATERIAL )

Enable or disable fast material changes via glColorMaterial().


GLvoid glColorMaterial( GLenum face, GLenum property ) 

Makes all subsequent glColor*() calls affect material properties. Often faster than using glMaterial*() when changing only one property rapidly. Valid face values are the same as for glMaterial*. property can be GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, or GL_AMBIENT_AND_DIFFUSE.