The glPrioritizeTextures function sets the residence priority of textures.
void glPrioritizeTextures(
GLsizei n,
GLuint * textures,
GLclampf * priorities
);
The glPrioritizeTextures function assigns the n texture priorities specified in the priorities parameter to the n textures named in the textures parameter. 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.
By specifying a priority for each texture, the glPrioritizeTextures function enables you to determine which textures should be resident.
The texture priorities elements in priorities are clamped to the range [0.0, 1.0] before being assigned. Zero indicates the lowest priority; thus textures with priority zero are least likely to be resident. The value 1.0 indicates the highest priority; thus textures with priority 1.0 are most likely to be resident. However, textures are not guaranteed to be resident until they are bound.
The glPrioritizeTextures function ignores attempts to prioritize textures with a priorities value of zero or any texture name that does not correspond to an existing texture. None of the functions named by the textures parameter need to be bound to a texture target.
If a texture is currently bound, you can also use the glTexParameter function to set its priority. This is the only way to set the priority of a default texture.
You can include glPrioritizeTextures in display lists.
Note The glPrioritizeTextures function is only available in OpenGL version 1.1 or later.
The following function retrieves the priority of a currently-bound texture related to glPrioritizeTextures:
glGetTexParameter with parameter name GL_TEXTURE_PRIORITY.
The following are the error codes generated and their conditions.
Error Code | Condition |
---|---|
GL_INVALID_VALUE | n was a negative value. |
GL_INVALID_OPERATION | glPrioritizeTextures was called between a call to glBegin and the corresponding call to glEnd. |
glAreTexturesResident, glBegin, glEnd, glGetTexParameter, glTexImage1D, glTexImage2D, glTexParameter