Home / comp / gb.opengl / gl / colormaterial 
Gl.ColorMaterial (gb.opengl)
Syntax
STATIC SUB ColorMaterial ( Face AS Integer, Mode AS Integer )

Cause a material color to track the current color

Parameters

Description

  Gl.ColorMaterial specifies which material parameters track the current color. When Gl.GL_COLOR_MATERIAL is enabled, the material parameter or parameters specified by Mode, of the material or materials specified by Face, track the current color at all times. Gl.GL_COLOR_MATERIAL is enabled and disabled using the commands Gl.Enable and Gl.Disable, called with Gl.GL_COLOR_MATERIAL as their argument. By default, it is disabled.

Gl.ColorMaterial allows a subset of material parameters to be changed for each vertex using only the Gl.Color command, without calling Gl.Material. If only such a subset of parameters is to be specified for each vertex, Gl.ColorMaterial is preferred over calling Gl.Material.

Errors

Gl.GL_INVALID_ENUM is generated if face or mode is not an accepted value.
Gl.GL_INVALID_OPERATION is generated if Gl.ColorMaterial is called between a call to Gl.Begin and the corresponding call to Gl.End.

Associated Gets

Gl.IsEnabled with argument Gl.GL_COLOR_MATERIAL
Gl.GetColorMaterialParameter
Gl.GetColorMaterialFace


See also
Gl.Color3f , Gl.Enable , Gl.Light, Gl.LightModel, Gl.Material