core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

texstate.c File Reference


Detailed Description

Texture state handling.

#include "glheader.h"
#include "mfeatures.h"
#include "colormac.h"
#include "colortab.h"
#include "context.h"
#include "enums.h"
#include "macros.h"
#include "texcompress.h"
#include "texobj.h"
#include "teximage.h"
#include "texstate.h"
#include "texenvprogram.h"
#include "mtypes.h"

Functions

void _mesa_copy_texture_state (const GLcontext *src, GLcontext *dst)
 Used by glXCopyContext to copy texture state from one context to another.
void _mesa_print_texunit_state (GLcontext *ctx, GLuint unit)
static void calculate_derived_texenv (struct gl_tex_env_combine_state *state, GLenum mode, GLenum texBaseFormat)
 Convert "classic" texture environment to ARB_texture_env_combine style environments.
void GLAPIENTRY _mesa_ActiveTextureARB (GLenum texture)
void GLAPIENTRY _mesa_ClientActiveTextureARB (GLenum texture)
static void update_texture_matrices (GLcontext *ctx)
 
Note:
This routine refers to derived texture attribute values to compute the ENABLE_TEXMAT flags, but is only called on _NEW_TEXTURE_MATRIX.

static void update_tex_combine (GLcontext *ctx, struct gl_texture_unit *texUnit)
 Examine texture unit's combine/env state to update derived state.
static void update_texture_state (GLcontext *ctx)
 
Note:
This routine refers to derived texture matrix values to compute the ENABLE_TEXMAT flags, but is only called on _NEW_TEXTURE.

void _mesa_update_texture (GLcontext *ctx, GLuint new_state)
 Update texture-related derived state.
static GLboolean alloc_proxy_textures (GLcontext *ctx)
 Allocate the proxy textures for the given context.
static void init_texture_unit (GLcontext *ctx, GLuint unit)
 Initialize a texture unit.
GLboolean _mesa_init_texture (GLcontext *ctx)
 Initialize texture state for the given context.
void _mesa_free_texture_data (GLcontext *ctx)
 Free dynamically-allocted texture data attached to the given context.
void _mesa_update_default_objects_texture (GLcontext *ctx)
 Update the default texture objects in the given context to reference those specified in the shared state and release those referencing the old shared state.

Variables

static struct
gl_tex_env_combine_state 
default_combine_state
 Default texture combine environment state.


Function Documentation

void GLAPIENTRY _mesa_ActiveTextureARB ( GLenum  texture  ) 

void GLAPIENTRY _mesa_ClientActiveTextureARB ( GLenum  texture  ) 

void _mesa_copy_texture_state ( const GLcontext src,
GLcontext dst 
)

Used by glXCopyContext to copy texture state from one context to another.

void _mesa_free_texture_data ( GLcontext ctx  ) 

Free dynamically-allocted texture data attached to the given context.

GLboolean _mesa_init_texture ( GLcontext ctx  ) 

Initialize texture state for the given context.

void _mesa_print_texunit_state ( GLcontext ctx,
GLuint  unit 
)

void _mesa_update_default_objects_texture ( GLcontext ctx  ) 

Update the default texture objects in the given context to reference those specified in the shared state and release those referencing the old shared state.

void _mesa_update_texture ( GLcontext ctx,
GLuint  new_state 
)

Update texture-related derived state.

static GLboolean alloc_proxy_textures ( GLcontext ctx  )  [static]

Allocate the proxy textures for the given context.

Parameters:
ctx the context to allocate proxies for.
Returns:
GL_TRUE on success, or GL_FALSE on failure
If run out of memory part way through the allocations, clean up and return GL_FALSE.

static void calculate_derived_texenv ( struct gl_tex_env_combine_state state,
GLenum  mode,
GLenum  texBaseFormat 
) [static]

Convert "classic" texture environment to ARB_texture_env_combine style environments.

Parameters:
state texture_env_combine state vector to be filled-in.
mode Classic texture environment mode (i.e., GL_REPLACE, GL_BLEND, GL_DECAL, etc.).
texBaseFormat Base format of the texture associated with the texture unit.

static void init_texture_unit ( GLcontext ctx,
GLuint  unit 
) [static]

Initialize a texture unit.

Parameters:
ctx GL context.
unit texture unit number to be initialized.

static void update_tex_combine ( GLcontext ctx,
struct gl_texture_unit texUnit 
) [static]

Examine texture unit's combine/env state to update derived state.

static void update_texture_matrices ( GLcontext ctx  )  [static]

Note:
This routine refers to derived texture attribute values to compute the ENABLE_TEXMAT flags, but is only called on _NEW_TEXTURE_MATRIX.

On changes to _NEW_TEXTURE, the ENABLE_TEXMAT flags are updated by _mesa_update_textures(), below.

Parameters:
ctx GL context.

static void update_texture_state ( GLcontext ctx  )  [static]

Note:
This routine refers to derived texture matrix values to compute the ENABLE_TEXMAT flags, but is only called on _NEW_TEXTURE.

On changes to _NEW_TEXTURE_MATRIX, the ENABLE_TEXMAT flags are updated by _mesa_update_texture_matrices, above.

Parameters:
ctx GL context.


Variable Documentation

struct gl_tex_env_combine_state default_combine_state [static]

Initial value:

 {
   GL_MODULATE, GL_MODULATE,
   { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
   { GL_TEXTURE, GL_PREVIOUS, GL_CONSTANT, GL_CONSTANT },
   { GL_SRC_COLOR, GL_SRC_COLOR, GL_SRC_ALPHA, GL_SRC_ALPHA },
   { GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA, GL_SRC_ALPHA },
   0, 0,
   2, 2
}
Default texture combine environment state.

This is used to initialize a context's texture units and as the basis for converting "classic" texture environmnets to ARB_texture_env_combine style values.


Generated on Sun Sep 27 06:47:46 2009 for Mesa Main by  doxygen 1.5.4