core  array_cache  math  swrast  swrast_setup  tnl  tnl_dd 
Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

texobj.h File Reference

Texture object management. More...

#include "mtypes.h"

Internal functions

gl_texture_object_mesa_new_texture_object (GLcontext *ctx, GLuint name, GLenum target)
 Allocate and initialize a new texture object. More...

void _mesa_initialize_texture_object (struct gl_texture_object *obj, GLuint name, GLenum target)
 Initialize a texture object to default values. More...

void _mesa_delete_texture_object (GLcontext *ctx, struct gl_texture_object *obj)
 Deallocate a texture object struct. More...

void _mesa_save_texture_object (GLcontext *ctx, struct gl_texture_object *obj)
 Add the given texture object to the texture object pool. More...

void _mesa_remove_texture_object (GLcontext *ctx, struct gl_texture_object *obj)
 Remove the given texture object from the texture object pool. More...

void _mesa_copy_texture_object (struct gl_texture_object *dest, const struct gl_texture_object *src)
 Copy texture object state from one texture object to another. More...

void _mesa_test_texobj_completeness (const GLcontext *ctx, struct gl_texture_object *obj)
 Examine a texture object to determine if it is complete. More...


API functions

void GLAPIENTRY _mesa_GenTextures (GLsizei n, GLuint *textures)
 Generate texture names. More...

void GLAPIENTRY _mesa_DeleteTextures (GLsizei n, const GLuint *textures)
 Delete named textures. More...

void GLAPIENTRY _mesa_BindTexture (GLenum target, GLuint texture)
 Bind a named texture to a texturing target. More...

void GLAPIENTRY _mesa_PrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities)
 Set texture priorities. More...

GLboolean GLAPIENTRY _mesa_AreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences)
 See if textures are loaded in texture memory. More...

GLboolean GLAPIENTRY _mesa_IsTexture (GLuint texture)
 See if a name corresponds to a texture. More...


Detailed Description

Texture object management.


Function Documentation

GLboolean GLAPIENTRY _mesa_AreTexturesResident GLsizei    n,
const GLuint *    textures,
GLboolean *    residences
 

See if textures are loaded in texture memory.

Parameters:
n  number of textures to query.
texName  array with the texture names.
residences  array which will hold the residence status.
Returns:
GL_TRUE if all textures are resident and residences is left unchanged,
See also:
glAreTexturesResident().
Looks up each texture in the hash and calls dd_function_table::IsTextureResident.

void GLAPIENTRY _mesa_BindTexture GLenum    target,
GLuint    texture
 

Bind a named texture to a texturing target.

Parameters:
target  texture target.
texName  texture name.
See also:
glBindTexture().
Determines the old texture object bound and returns immediately if rebinding the same texture. Get the current texture which is either a default texture if name is null, a named texture from the hash, or a new texture if the given texture name is new. Increments its reference count, binds it, and calls dd_function_table::BindTexture. Decrements the old texture reference count and deletes it if it reaches zero.

void _mesa_copy_texture_object struct gl_texture_object   dest,
const struct gl_texture_object   src
 

Copy texture object state from one texture object to another.

Parameters:
dest  destination texture object.
src  source texture object.

void _mesa_delete_texture_object GLcontext   ctx,
struct gl_texture_object   obj
 

Deallocate a texture object struct.

It should have already been removed from the texture object pool.

Parameters:
shared  the shared GL state to which the object belongs.
texOjb  the texture object to delete.

void GLAPIENTRY _mesa_DeleteTextures GLsizei    n,
const GLuint *    textures
 

Delete named textures.

Parameters:
n  number of textures to be deleted.
textures  array of texture IDs to be deleted.
See also:
glDeleteTextures().
If we're about to delete a texture that's currently bound to any texture unit, unbind the texture first. Decrement the reference count on the texture object and delete it if it's zero. Recall that texture objects can be shared among several rendering contexts.

void GLAPIENTRY _mesa_GenTextures GLsizei    n,
GLuint *    textures
 

Generate texture names.

Parameters:
n  number of texture names to be generated.
textures  an array in which will hold the generated texture names.
See also:
glGenTextures().
While holding the GenTexturesLock lock, calls _mesa_HashFindFreeKeyBlock() to find a block of free texture IDs which are stored in textures. Corresponding empty texture objects are also generated.

void _mesa_initialize_texture_object struct gl_texture_object   obj,
GLuint    name,
GLenum    target
 

Initialize a texture object to default values.

Parameters:
obj  the texture object
name  the texture name
target  the texture target

GLboolean GLAPIENTRY _mesa_IsTexture GLuint    texture
 

See if a name corresponds to a texture.

Parameters:
texture  texture name.
Returns:
GL_TRUE if texture name corresponds to a texture, or GL_FALSE otherwise.
See also:
glIsTexture().
Calls _mesa_HashLookup().

struct gl_texture_object* _mesa_new_texture_object GLcontext   ctx,
GLuint    name,
GLenum    target
 

Allocate and initialize a new texture object.

But don't put it into the texture object hash table.

Called via ctx->Driver.NewTextureObject, unless overridden by a device driver.

Parameters:
shared  the shared GL state structure to contain the texture object
name  integer name for the texture object
target  either GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D, GL_TEXTURE_CUBE_MAP_ARB or GL_TEXTURE_RECTANGLE_NV. zero is ok for the sake of GenTextures()
Returns:
pointer to new texture object.

void GLAPIENTRY _mesa_PrioritizeTextures GLsizei    n,
const GLuint *    textures,
const GLclampf *    priorities
 

Set texture priorities.

Parameters:
n  number of textures.
texName  texture names.
priorities  corresponding texture priorities.
See also:
glPrioritizeTextures().
Looks up each texture in the hash, clamps the corresponding priority between 0.0 and 1.0, and calls dd_function_table::PrioritizeTexture.

void _mesa_remove_texture_object GLcontext   ctx,
struct gl_texture_object   obj
 

Remove the given texture object from the texture object pool.

Do not deallocate the texture object though.

void _mesa_save_texture_object GLcontext   ctx,
struct gl_texture_object   obj
 

Add the given texture object to the texture object pool.

void _mesa_test_texobj_completeness const GLcontext   ctx,
struct gl_texture_object   obj
 

Examine a texture object to determine if it is complete.

The gl_texture_object::Complete flag will be set to GL_TRUE or GL_FALSE accordingly.

Parameters:
ctx  GL context.
t  texture object.
According to the texture target, verifies that each of the mipmaps is present and has the expected size.


Generated on Sun May 16 15:55:12 2004 for Mesa Core by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001