diff options
Diffstat (limited to 'src/mesa/main/occlude.c')
-rw-r--r-- | src/mesa/main/occlude.c | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c index d329f11f09..bc61a475d6 100644 --- a/src/mesa/main/occlude.c +++ b/src/mesa/main/occlude.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.0.2 * * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. * @@ -45,20 +45,6 @@ struct occlusion_query }; - -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 @@ -327,3 +313,41 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) return; } } + + + +/** + * Allocate/init the context state related to occlusion query objects. + */ +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; +} + + +/** + * Free the context state related to occlusion query objects. + */ +void +_mesa_free_occlude_data(GLcontext *ctx) +{ + while (1) { + GLuint query = _mesa_HashFirstEntry(ctx->Occlusion.QueryObjects); + if (query) { + struct occlusion_query *q = (struct occlusion_query *) + _mesa_HashLookup(ctx->Occlusion.QueryObjects, query); + ASSERT(q); + delete_query_object(q); + _mesa_HashRemove(ctx->Occlusion.QueryObjects, query); + } + else { + break; + } + } + _mesa_DeleteHashTable(ctx->Occlusion.QueryObjects); +} |