Key OpenGL texture-mapping commands to know


glGenTextures:                      Get the names (i.e. ID numbers) for texture objects

void glGenTextures(GLsizei n, GLuint *textureNames);

Returns n currently unused names for texture objects in the array textureNames.

The names returned in textureNames do not have to be a contiguous set of integers.

The names in textureNames are marked as used,

but they acquire texture state and dimensionality (1D or 2D) only when they are first bound.

Zero is a reserved texture name and is never returned as a texture name by glGenTextures().



glBindTexture:           Create and/or Select a particular texture object

void glBindTexture(GLenum target, GLuint textureName);

glBindTexture() does three things. When using textureName of

 an unsigned integer other than zero for the first time, a new texture object is created and assigned that name.

When binding to a previously created texture object, that texture object becomes active.

When binding to a textureName value of zero, OpenGL stops using texture objects and returns to the unnamed default texture.

When a texture object is initially bound (that is, created), it assumes the dimensionality of target, which is either GL_TEXTURE_1D or GL_TEXTURE_2D. Immediately upon its initial binding, the state of texture object is equivalent to the state of the default GL_TEXTURE_1D or GL_TEXTURE_2D (depending upon its dimensionality) at the initialization of OpenGL. In this initial state, texture properties such as minification and magnification filters, wrapping modes, border color, and texture priority are set to their default values.


glTexEnv                      Set the texture environment

glTexParameter            Set parameter of texture mapping



glTexImage2D              Load texture image into a texture object


gluBuild2DMipmaps     build mipmaps and load  the texture images into a texture object


glTexCoord                  Align the texture coordinates with the world coordinates