The glAreTexturesResident function determines whether specified texture objects are resident.
GLboolean glAreTexturesResident(
GLsizei n,
GLuint * textures
GLboolean * residences
);
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.
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.
Note The glAreTexturesResident function is only available in OpenGL version 1.1 or later.
The following are the error codes generated and their conditions.
Error Code | Condition |
---|---|
GL_INVALID_VALUE | n was a negative value. |
GL_INVALID_VALUE | An element in textures was zero or did not contain a texture name. |
GL_INVALID_OPERATION | glAreTexturesResident was called between a call to glBegin and the corresponding call to glEnd. |
glBegin, glBindTexture, glEnd, glGetTexParameter, glPrioritizeTextures, glTexImage1D, glTexImage2D