#include "mtypes.h"
Functions | |
Internal functions | |
| struct gl_texture_object * | _mesa_lookup_texture (GLcontext *ctx, GLuint id) |
| Return the gl_texture_object for a given ID. | |
| struct gl_texture_object * | _mesa_new_texture_object (GLcontext *ctx, GLuint name, GLenum target) |
| Allocate and initialize a new texture object. | |
| void | _mesa_initialize_texture_object (struct gl_texture_object *obj, GLuint name, GLenum target) |
| Initialize a new texture object to default values. | |
| void | _mesa_delete_texture_object (GLcontext *ctx, struct gl_texture_object *obj) |
| Deallocate a texture object struct. | |
| 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. | |
| void | _mesa_clear_texture_object (GLcontext *ctx, struct gl_texture_object *obj) |
| Clear all texture images of the given texture object. | |
| void | _mesa_reference_texobj (struct gl_texture_object **ptr, struct gl_texture_object *tex) |
| Reference (or unreference) a texture object. | |
| void | _mesa_test_texobj_completeness (const GLcontext *ctx, struct gl_texture_object *obj) |
| Examine a texture object to determine if it is complete. | |
| void | _mesa_dirty_texobj (GLcontext *ctx, struct gl_texture_object *texObj, GLboolean invalidate_state) |
| Mark a texture object dirty. | |
| struct gl_texture_object * | _mesa_get_fallback_texture (GLcontext *ctx) |
| Return pointer to a default/fallback texture. | |
| void | _mesa_unlock_context_textures (GLcontext *ctx) |
| void | _mesa_lock_context_textures (GLcontext *ctx) |
| Simplest implementation of texture locking: grab the shared tex mutex. | |
API functions | |
| void GLAPIENTRY | _mesa_GenTextures (GLsizei n, GLuint *textures) |
| Generate texture names. | |
| void GLAPIENTRY | _mesa_DeleteTextures (GLsizei n, const GLuint *textures) |
| Delete named textures. | |
| void GLAPIENTRY | _mesa_BindTexture (GLenum target, GLuint texture) |
| Bind a named texture to a texturing target. | |
| void GLAPIENTRY | _mesa_PrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities) |
| Set texture priorities. | |
| GLboolean GLAPIENTRY | _mesa_AreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences) |
| See if textures are loaded in texture memory. | |
| GLboolean GLAPIENTRY | _mesa_IsTexture (GLuint texture) |
| See if a name corresponds to a texture. | |
| GLboolean GLAPIENTRY _mesa_AreTexturesResident | ( | GLsizei | n, | |
| const GLuint * | texName, | |||
| GLboolean * | residences | |||
| ) |
See if textures are loaded in texture memory.
| n | number of textures to query. | |
| texName | array with the texture names. | |
| residences | array which will hold the residence status. |
residences is left unchanged,| void GLAPIENTRY _mesa_BindTexture | ( | GLenum | target, | |
| GLuint | texName | |||
| ) |
Bind a named texture to a texturing target.
| target | texture target. | |
| texName | texture name. |
| void _mesa_clear_texture_object | ( | GLcontext * | ctx, | |
| struct gl_texture_object * | texObj | |||
| ) |
Clear all texture images of the given texture object.
| ctx | GL context. | |
| t | texture object. |
| 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.
Use for glPush/PopAttrib.
| dest | destination texture object. | |
| src | source texture object. |
| void _mesa_delete_texture_object | ( | GLcontext * | ctx, | |
| struct gl_texture_object * | texObj | |||
| ) |
Deallocate a texture object struct.
It should have already been removed from the texture object pool. Called via ctx->Driver.DeleteTexture() if not overriden by a driver.
| shared | the shared GL state to which the object belongs. | |
| texObj | the texture object to delete. |
| void GLAPIENTRY _mesa_DeleteTextures | ( | GLsizei | n, | |
| const GLuint * | textures | |||
| ) |
Delete named textures.
| n | number of textures to be deleted. | |
| textures | array of texture IDs to be deleted. |
| void _mesa_dirty_texobj | ( | GLcontext * | ctx, | |
| struct gl_texture_object * | texObj, | |||
| GLboolean | invalidate_state | |||
| ) |
Mark a texture object dirty.
It forces the object to be incomplete and optionally forces the context to re-validate its state.
| ctx | GL context. | |
| texObj | texture object. | |
| invalidate_state | also invalidate context state. |
| void GLAPIENTRY _mesa_GenTextures | ( | GLsizei | n, | |
| GLuint * | textures | |||
| ) |
Generate texture names.
| n | number of texture names to be generated. | |
| textures | an array in which will hold the generated texture names. |
textures. Corresponding empty texture objects are also generated.
| struct gl_texture_object* _mesa_get_fallback_texture | ( | GLcontext * | ctx | ) | [read] |
Return pointer to a default/fallback texture.
The texture is a 2D 8x8 RGBA texture with all texels = (0,0,0,1). That's the value a sampler should get when sampling from an incomplete texture.
| void _mesa_initialize_texture_object | ( | struct gl_texture_object * | obj, | |
| GLuint | name, | |||
| GLenum | target | |||
| ) |
Initialize a new texture object to default values.
| 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.
| texture | texture name. |
| void _mesa_lock_context_textures | ( | GLcontext * | ctx | ) |
Simplest implementation of texture locking: grab the shared tex mutex.
Examine the shared context state timestamp and if there has been a change, set the appropriate bits in ctx->NewState.
This is used to deal with synchronizing things when a texture object is used/modified by different contexts (or threads) which are sharing the texture.
See also _mesa_lock/unlock_texture() in teximage.h
| struct gl_texture_object* _mesa_lookup_texture | ( | GLcontext * | ctx, | |
| GLuint | id | |||
| ) | [read] |
Return the gl_texture_object for a given ID.
| struct gl_texture_object* _mesa_new_texture_object | ( | GLcontext * | ctx, | |
| GLuint | name, | |||
| GLenum | target | |||
| ) | [read] |
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.
| 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() |
| void GLAPIENTRY _mesa_PrioritizeTextures | ( | GLsizei | n, | |
| const GLuint * | texName, | |||
| const GLclampf * | priorities | |||
| ) |
Set texture priorities.
| n | number of textures. | |
| texName | texture names. | |
| priorities | corresponding texture priorities. |
| void _mesa_reference_texobj | ( | struct gl_texture_object ** | ptr, | |
| struct gl_texture_object * | tex | |||
| ) |
Reference (or unreference) a texture object.
If '*ptr', decrement *ptr's refcount (and delete if it becomes zero). If 'tex' is non-null, increment its refcount.
| void _mesa_test_texobj_completeness | ( | const GLcontext * | ctx, | |
| struct gl_texture_object * | t | |||
| ) |
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.
| ctx | GL context. | |
| t | texture object. |
| void _mesa_unlock_context_textures | ( | GLcontext * | ctx | ) |
1.5.4