Since the program uses only one image map and, in turn, only one texture object, we define the properties of the object without naming the object. We establish the texture properties through calls to glTexParameteri; these properties include the filter, the wrapping method to be applied and the mode (see the Texture Coordinates tutorial). We must also identify the image map that will be applied. The latter is done with a call to the ImageMap function setTexture.

We have set the environment mode of the texture to GL_MODULATE. Recall that with GL_REPLACE the geometry's underlying color is simply replaced with the texture's color. A similar effect is achieved with GL_DECAL except for a transparency color. In the case of GL_MODULATE, the geometry's underlying color is combined with the texture's color. The calculation involves multiplying the two colors for each of the RGB components. Thus, when lighting is enabled and the underlying color of the geometry is set with a material, the illumination of the material will affect the color of the texture, which is seen here with our cube.