The glGenTextures function generates texture names.
void glGenTextures(
GLsizei n,
GLuint * textures
);
The glGenTextures function returns n texture names in the textures parameter. The texture names are not necessarily a contiguous set of integers, however, none of the returned names can have been in use immediately prior to calling the glGenTextures function. The generated textures assume the dimensionality of the texture target to which they are first bound with the glBindTexture function. Texture names returned by glGenTextures are not returned by subsequent calls to glGenTextures unless they are first deleted by calling glDeleteTextures.
You cannot include glGenTextures in display lists.
Note The glGenTextures function is only available in OpenGL version 1.1 or later.
The following function retrieves information related to glGenTextures:
The following are the error codes generated and their conditions.
Error Code | Condition |
---|---|
GL_INVALID_VALUE | n was a negative value. |
GL_INVALID_OPERATION | glGenTextures was called between a call to glBegin and the corresponding call to glEnd. |
glBegin, glBindTexture, glDeleteTextures, glEnd, glGet, glGetTexParameter, glIsTexture, glTexImage1D, glTexImage2D, glTexParameter