From 8dfc5b9863f08a713177fd92847573e17febbac9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Oct 2002 17:57:51 +0000 Subject: surround vertex program code with #if FEATURE_NV_vertex_program/#endif --- src/mesa/main/context.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/context.c') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b5872471c8..4bd36bbcde 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,4 +1,4 @@ -/* $Id: context.c,v 1.184 2002/10/14 17:08:17 brianp Exp $ */ +/* $Id: context.c,v 1.185 2002/10/16 17:57:51 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -633,7 +633,9 @@ alloc_shared_state( void ) ss->DisplayList = _mesa_NewHashTable(); ss->TexObjects = _mesa_NewHashTable(); +#if FEATURE_NV_vertex_program ss->VertexPrograms = _mesa_NewHashTable(); +#endif /* Default Texture objects */ outOfMemory = GL_FALSE; @@ -665,7 +667,10 @@ alloc_shared_state( void ) outOfMemory = GL_TRUE; } - if (!ss->DisplayList || !ss->TexObjects || !ss->VertexPrograms + if (!ss->DisplayList || !ss->TexObjects +#if FEATURE_NV_vertex_program + || !ss->VertexPrograms +#endif || outOfMemory) { /* Ran out of memory at some point. Free everything and return NULL */ if (ss->DisplayList) @@ -720,6 +725,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) } _mesa_DeleteHashTable(ss->TexObjects); +#if FEATURE_NV_vertex_program /* Free vertex programs */ while (1) { GLuint prog = _mesa_HashFirstEntry(ss->VertexPrograms); @@ -731,6 +737,7 @@ free_shared_state( GLcontext *ctx, struct gl_shared_state *ss ) } } _mesa_DeleteHashTable(ss->VertexPrograms); +#endif FREE(ss); } @@ -1928,11 +1935,13 @@ _mesa_free_context_data( GLcontext *ctx ) _math_matrix_dtr( &ctx->_ModelProjectMatrix ); +#if FEATURE_NV_vertex_program if (ctx->VertexProgram.Current) { ctx->VertexProgram.Current->RefCount--; if (ctx->VertexProgram.Current->RefCount <= 0) _mesa_delete_program(ctx, ctx->VertexProgram.CurrentID); } +#endif /* Shared context state (display lists, textures, etc) */ _glthread_LOCK_MUTEX(ctx->Shared->Mutex); -- cgit v1.2.3