glAreTexturesResident

The glAreTexturesResident function determines whether specified texture objects are resident in texture memory.

GLboolean glAreTexturesResident(
  GLsizei n,
  GLuint *textures
  GLboolean *residences
);

Parameters

n
The number of textures to be queried.
textures
The address of an array containing the names of the textures to be queried.
residences
The address of an array in which the texture residence status is returned. The residence status of a texture named by an element of textures is returned in the corresponding element of residences.

Remarks

On machines with a limited amount of texture memory, OpenGL establishes a working set' of textures that are resident in texture memory. These textures can be bound to a texture target much more efficiently than textures that are not resident.

The glAreTexturesResident function queries the texture residence status of the n textures named by the elements of textures. If all the named textures are resident, glAreTexturesResident returns GL_TRUE, and the contents of residences are undisturbed. If any of the named textures are not resident, glAreTexturesResident returns GL_FALSE, and detailed status is returned in the n elements of residences.

If an element of residences is GL_TRUE, then the texture named by the corresponding element of textures is resident in texture memory.

To query the residence status of a single bound texture, call glGetTexParameter with the target parameter set to the target texture to which the target is bound and set the pname parameter to GL_TEXTURE_RESIDENT. You must use this method to query the resident status of a default texture.

You cannot include glAreTexturesResident in display lists.

The glAreTexturesResident function returns the residency status of the textures at the time of invocation. It does not guarantee that the textures will remain resident at any other time.

If textures reside in virtual memory (there is no texture memory), they are considered always resident.

Note  The glAreTexturesResident function is only available in OpenGL version 1.1 or later.

Error Codes

The following are the error codes generated and their conditions.

Error code Condition
GL_INVALID_VALUE n was a negative value, an element in textures was zero, or an element in textures did not contain a texture identifier.
GL_INVALID_OPERATION glAreTexturesResident was called between a call to glBegin and the corresponding call to glEnd.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in Gl.h.
  Library: Use Opengl32.lib.

See Also

glBegin, glBindTexture, glEnd, glGetTexParameter, glPrioritizeTextures, glTexImage1D, glTexImage2D


  

Community Additions

Show: