summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>1999-09-19 23:43:02 +0000
committerKeith Whitwell <keith@tungstengraphics.com>1999-09-19 23:43:02 +0000
commit5a437d588975ec0e241a2bf7cc4ce3785cb476bd (patch)
treee6cf1e6822ddd7cc4781ae7871d7fe8072e8ab9d /src/mesa
parentc6569511103235fd29a89ea6dd0c21913805b1d2 (diff)
Cleaning up
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/attrib.c3
-rw-r--r--src/mesa/main/context.c21
-rw-r--r--src/mesa/main/depth.c3
3 files changed, 22 insertions, 5 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index c4dae95739..80aee7b8c0 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.3 1999/09/18 20:41:22 keithw Exp $ */
+/* $Id: attrib.c,v 1.4 1999/09/19 23:43:02 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -492,6 +492,7 @@ void gl_PopAttrib( GLcontext* ctx )
}
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL);
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
+ TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 9b12ad0ede..d7f751dba5 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.8 1999/09/18 20:41:22 keithw Exp $ */
+/* $Id: context.c,v 1.9 1999/09/19 23:43:02 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -1350,10 +1350,17 @@ void gl_destroy_context( GLcontext *ctx )
for (i = 0 ; i < MAX_MODELVIEW_STACK_DEPTH ; i++) {
gl_matrix_dtr( &ctx->ModelViewStack[i] );
}
-
+ gl_matrix_dtr( &ctx->ProjectionMatrix );
+ for (i = 0 ; i < MAX_PROJECTION_STACK_DEPTH ; i++) {
+ gl_matrix_dtr( &ctx->ProjectionStack[i] );
+ }
free( ctx->PB );
- free( ctx->VB );
+
+ if(ctx->input != ctx->VB->IM)
+ gl_immediate_free( ctx->input );
+
+ gl_vb_free( ctx->VB );
ctx->Shared->RefCount--;
assert(ctx->Shared->RefCount>=0);
@@ -1411,6 +1418,14 @@ void gl_destroy_context( GLcontext *ctx )
if (ctx->EvalMap.Map2Texture4.Points)
free( ctx->EvalMap.Map2Texture4.Points );
+ /* Free cache of immediate buffers. */
+ while (ctx->nr_im_queued-- > 0) {
+ struct immediate * next = ctx->freed_im_queue->next;
+ free( ctx->freed_im_queue );
+ ctx->freed_im_queue = next;
+ }
+ gl_extensions_dtr(ctx);
+
free( (void *) ctx );
#ifndef THREADS
diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
index 7ac2be01da..7fac718492 100644
--- a/src/mesa/main/depth.c
+++ b/src/mesa/main/depth.c
@@ -1,4 +1,4 @@
-/* $Id: depth.c,v 1.2 1999/09/10 14:24:35 keithw Exp $ */
+/* $Id: depth.c,v 1.3 1999/09/19 23:43:02 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -817,6 +817,7 @@ void gl_alloc_depth_buffer( GLcontext* ctx )
if (!ctx->Buffer->Depth) {
/* out of memory */
ctx->Depth.Test = GL_FALSE;
+ ctx->NewState |= NEW_RASTER_OPS;
gl_error( ctx, GL_OUT_OF_MEMORY, "Couldn't allocate depth buffer" );
}
}