diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-07-17 13:43:59 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-07-17 13:43:59 +0000 |
commit | 6dc85575000127630489b407c50a4b3ea87c9acb (patch) | |
tree | c79b24b7059577caf8201eeb7a42a6890721f52b /src/mesa/main/colortab.c | |
parent | 44c699949ac09459771304a8aec8f2fc622057fb (diff) |
Merge Jose's documentation and core Mesa changes from embedded branch
Diffstat (limited to 'src/mesa/main/colortab.c')
-rw-r--r-- | src/mesa/main/colortab.c | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 78ef93caa6..9a1734bf4b 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -92,26 +92,6 @@ base_colortab_format( GLenum format ) } -void -_mesa_init_colortable( struct gl_color_table *p ) -{ - p->FloatTable = GL_FALSE; - p->Table = NULL; - p->Size = 0; - p->IntFormat = GL_RGBA; -} - - - -void -_mesa_free_colortable_data( struct gl_color_table *p ) -{ - if (p->Table) { - FREE(p->Table); - p->Table = NULL; - } -} - /* * Examine table's format and set the component sizes accordingly. @@ -1345,3 +1325,49 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) return; } } + +/**********************************************************************/ +/***** Initialization *****/ +/**********************************************************************/ + + +void +_mesa_init_one_colortable( struct gl_color_table *p ) +{ + p->FloatTable = GL_FALSE; + p->Table = NULL; + p->Size = 0; + p->IntFormat = GL_RGBA; +} + + + +void +_mesa_free_one_colortable( struct gl_color_table *p ) +{ + if (p->Table) { + FREE(p->Table); + p->Table = NULL; + } +} + +void _mesa_init_colortable( GLcontext * ctx ) +{ + /* Color tables */ + _mesa_init_one_colortable(&ctx->ColorTable); + _mesa_init_one_colortable(&ctx->ProxyColorTable); + _mesa_init_one_colortable(&ctx->PostConvolutionColorTable); + _mesa_init_one_colortable(&ctx->ProxyPostConvolutionColorTable); + _mesa_init_one_colortable(&ctx->PostColorMatrixColorTable); + _mesa_init_one_colortable(&ctx->ProxyPostColorMatrixColorTable); +} + +void _mesa_free_colortable_data( GLcontext *ctx ) +{ + _mesa_free_one_colortable( &ctx->ColorTable ); + _mesa_free_one_colortable( &ctx->ProxyColorTable ); + _mesa_free_one_colortable( &ctx->PostConvolutionColorTable ); + _mesa_free_one_colortable( &ctx->ProxyPostConvolutionColorTable ); + _mesa_free_one_colortable( &ctx->PostColorMatrixColorTable ); + _mesa_free_one_colortable( &ctx->ProxyPostColorMatrixColorTable ); +} |