Rename colortable-related functions.
}
+/*
+ * Init context's program state
+ */
+void
+_mesa_init_program(GLcontext *ctx)
+{
+ GLuint i;
+
+ ctx->Program.ErrorPos = -1;
+ ctx->Program.ErrorString = _mesa_strdup("");
+
+#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
+ ctx->VertexProgram.Enabled = GL_FALSE;
+ ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
+ ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
+ ctx->VertexProgram.Current = NULL;
+ ctx->VertexProgram.Current = (struct vertex_program *) ctx->Shared->DefaultVertexProgram;
+ assert(ctx->VertexProgram.Current);
+ ctx->VertexProgram.Current->Base.RefCount++;
+ for (i = 0; i < VP_NUM_PROG_REGS / 4; i++) {
+ ctx->VertexProgram.TrackMatrix[i] = GL_NONE;
+ ctx->VertexProgram.TrackMatrixTransform[i] = GL_IDENTITY_NV;
+ }
+#endif
+
+#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
+ ctx->FragmentProgram.Enabled = GL_FALSE;
+ ctx->FragmentProgram.Current = (struct fragment_program *) ctx->Shared->DefaultFragmentProgram;
+ assert(ctx->FragmentProgram.Current);
+ ctx->FragmentProgram.Current->Base.RefCount++;
+#endif
+}
+
void
_mesa_EnableVertexAttribArrayARB(GLuint index)
#ifndef ARBPROGRAM_H
#define ARBPROGRAM_H
+#include "mtypes.h"
+
+extern void
+_mesa_init_program(GLcontext *ctx);
+
extern void
_mesa_EnableVertexAttribArrayARB(GLuint index);
void
-_mesa_init_one_colortable( struct gl_color_table *p )
+_mesa_init_colortable( struct gl_color_table *p )
{
p->FloatTable = GL_FALSE;
p->Table = NULL;
void
-_mesa_free_one_colortable( struct gl_color_table *p )
+_mesa_free_colortable_data( struct gl_color_table *p )
{
if (p->Table) {
FREE(p->Table);
}
}
-void _mesa_init_colortable( GLcontext * ctx )
+
+/*
+ * Initialize all colortables for a context.
+ */
+void _mesa_init_colortables( 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);
+ _mesa_init_colortable(&ctx->ColorTable);
+ _mesa_init_colortable(&ctx->ProxyColorTable);
+ _mesa_init_colortable(&ctx->PostConvolutionColorTable);
+ _mesa_init_colortable(&ctx->ProxyPostConvolutionColorTable);
+ _mesa_init_colortable(&ctx->PostColorMatrixColorTable);
+ _mesa_init_colortable(&ctx->ProxyPostColorMatrixColorTable);
}
-void _mesa_free_colortable_data( GLcontext *ctx )
+
+/*
+ * Free all colortable data for a context
+ */
+void _mesa_free_colortables_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 );
+ _mesa_free_colortable_data(&ctx->ColorTable);
+ _mesa_free_colortable_data(&ctx->ProxyColorTable);
+ _mesa_free_colortable_data(&ctx->PostConvolutionColorTable);
+ _mesa_free_colortable_data(&ctx->ProxyPostConvolutionColorTable);
+ _mesa_free_colortable_data(&ctx->PostColorMatrixColorTable);
+ _mesa_free_colortable_data(&ctx->ProxyPostColorMatrixColorTable);
}
extern void
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params );
-extern void
-_mesa_init_colortable( GLcontext * ctx );
-extern void
-_mesa_free_colortable_data( GLcontext * ctx );
extern void
-_mesa_free_one_colortable( struct gl_color_table *p );
+_mesa_init_colortable( struct gl_color_table *table );
extern void
-_mesa_init_one_colortable( struct gl_color_table *p );
+_mesa_free_colortable_data( struct gl_color_table *table );
+
+extern void
+_mesa_init_colortables( GLcontext *ctx );
+
+extern void
+_mesa_free_colortables_data( GLcontext *ctx );
#else
/** No-op */
-#define _mesa_init_one_colortable( p ) ((void)0)
+#define _mesa_init_colortable( p ) ((void) 0)
+
+/** No-op */
+#define _mesa_free_colortable_data( p ) ((void) 0)
/** No-op */
-#define _mesa_init_colortable( p ) ((void)0)
+#define _mesa_init_colortables( p ) ((void)0)
/** No-op */
-#define _mesa_free_colortable_data( p ) ((void)0)
+#define _mesa_free_colortables_data( p ) ((void)0)
#endif
#include "glheader.h"
#include "imports.h"
#include "accum.h"
+#include "arbprogram.h"
#include "attrib.h"
#include "blend.h"
#include "buffers.h"
#include "lines.h"
#include "macros.h"
#include "matrix.h"
+#include "occlude.h"
#include "pixel.h"
#include "points.h"
#include "polygon.h"
_mesa_init_attrib( ctx );
_mesa_init_buffers( ctx );
_mesa_init_color( ctx );
- _mesa_init_colortable( ctx );
+ _mesa_init_colortables( ctx );
_mesa_init_current( ctx );
_mesa_init_depth( ctx );
_mesa_init_debug( ctx );
_mesa_init_line( ctx );
_mesa_init_lighting( ctx );
_mesa_init_matrix( ctx );
+ _mesa_init_occlude( ctx );
_mesa_init_pixel( ctx );
_mesa_init_point( ctx );
_mesa_init_polygon( ctx );
- /* XXX _mesa_init_program( ctx ); */
+ _mesa_init_program( ctx );
_mesa_init_rastpos( ctx );
_mesa_init_stencil( ctx );
_mesa_init_transform( ctx );
_mesa_free_texture_data( ctx );
_mesa_free_matrix_data( ctx );
_mesa_free_viewport_data( ctx );
- _mesa_free_colortable_data( ctx );
+ _mesa_free_colortables_data( ctx );
#if FEATURE_NV_vertex_program
if (ctx->VertexProgram.Current) {
ctx->VertexProgram.Current->Base.RefCount--;
};
+
+void
+_mesa_init_occlude(GLcontext *ctx)
+{
+#if FEATURE_ARB_occlusion_query
+ ctx->Occlusion.QueryObjects = _mesa_NewHashTable();
+#endif
+
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
+}
+
+
+
/**
* Allocate a new occlusion query object.
* \param target - must be GL_SAMPLES_PASSED_ARB at this time
#define OCCLUDE_H
+extern void
+_mesa_init_occlude(GLcontext *ctx);
+
extern void
_mesa_GenQueriesARB(GLsizei n, GLuint *ids);
obj->CompareFunc = GL_LEQUAL; /* ARB_shadow */
obj->DepthMode = GL_LUMINANCE; /* ARB_depth_texture */
obj->ShadowAmbient = 0.0F; /* ARB/SGIX_shadow_ambient */
- _mesa_init_one_colortable(&obj->Palette);
+ _mesa_init_colortable(&obj->Palette);
}
assert(texObj);
- _mesa_free_one_colortable(&texObj->Palette);
+ _mesa_free_colortable_data(&texObj->Palette);
/* free the texture images */
for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
for (i=0; i<MAX_TEXTURE_UNITS; i++)
init_texture_unit( ctx, i );
ctx->Texture.SharedPalette = GL_FALSE;
- _mesa_init_one_colortable(&ctx->Texture.Palette);
+ _mesa_init_colortable(&ctx->Texture.Palette);
/* Allocate proxy textures */
if (!alloc_proxy_textures( ctx ))
(ctx->Driver.DeleteTexture)(ctx, ctx->Texture.ProxyRect );
for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++)
- _mesa_free_one_colortable( &ctx->Texture.Unit[i].ColorTable );
+ _mesa_free_colortable_data( &ctx->Texture.Unit[i].ColorTable );
}