Export (0) Print
Expand All
Expand Minimize

glGenTextures function

Applies to: desktop apps only

The glGenTextures function generates texture names.

Syntax

void WINAPI glGenTextures(
  GLsizei n,
  GLuint *textures
);

Parameters

n

The number of texture names to be generated.

textures

A pointer to the first element of an array in which the generated texture names are stored.

Return value

This function does not return a value.

Error codes

The following error codes can be retrieved by the glGetError function.

NameMeaning
GL_INVALID_VALUE

n was a negative value.

GL_INVALID_OPERATION

The function was called between a call to glBegin and the corresponding call to glEnd.

Remarks

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:

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Gl.h

Library

Opengl32.lib

DLL

Opengl32.dll

See also

glBegin
glBindTexture
glDeleteTextures
glEnd
glGet
glGetTexParameter
glIsTexture
glTexImage1D
glTexImage2D
glTexParameter

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show:
© 2014 Microsoft