summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-04-04 15:14:10 +0000
committerBrian Paul <[email protected]>2000-04-04 15:14:10 +0000
commit7e67fb41fb54e050f6983b4de09ed3a317d6148f (patch)
tree810a196fa33056afcc65f91300e165c5d69b98f5 /src/mesa/main
parent941dcc797e1a6317808c1ec43476817286d576ba (diff)
more GL_HP_occlusion_test work
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c3
-rw-r--r--src/mesa/main/enable.c6
-rw-r--r--src/mesa/main/get.c38
3 files changed, 36 insertions, 11 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 92077533126..ca95e430c0b 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.52 2000/03/31 01:05:51 brianp Exp $ */
+/* $Id: context.c,v 1.53 2000/04/04 15:14:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1276,6 +1276,7 @@ static void init_attrib_groups( GLcontext *ctx )
ctx->CatchSignals = GL_TRUE;
ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
/* For debug/development only */
ctx->NoRaster = getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 0e1a5781bdd..fa0c84f1731 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.12 2000/03/11 23:23:26 brianp Exp $ */
+/* $Id: enable.c,v 1.13 2000/04/04 15:14:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -455,6 +455,10 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
case GL_OCCLUSION_TEST_HP:
if (ctx->Extensions.HaveHpOcclusionTest) {
ctx->Depth.OcclusionTest = state;
+ if (state)
+ ctx->OcclusionResult = ctx->OcclusionResultSaved;
+ else
+ ctx->OcclusionResultSaved = ctx->OcclusionResult;
ctx->NewState |= NEW_RASTER_OPS;
}
else {
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 136d89689aa..2552f305191 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,4 +1,4 @@
-/* $Id: get.c,v 1.16 2000/03/31 01:04:52 brianp Exp $ */
+/* $Id: get.c,v 1.17 2000/04/04 15:14:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1029,8 +1029,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
return;
case GL_OCCLUSION_TEST_RESULT_HP:
if (ctx->Extensions.HaveHpOcclusionTest) {
- *params = ctx->OcclusionResult;
- ctx->OcclusionResult = GL_FALSE; /* reset now */
+ if (ctx->Depth.OcclusionTest)
+ *params = ctx->OcclusionResult;
+ else
+ *params = ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
@@ -2016,8 +2021,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
return;
case GL_OCCLUSION_TEST_RESULT_HP:
if (ctx->Extensions.HaveHpOcclusionTest) {
- *params = (GLdouble) ctx->OcclusionResult;
- ctx->OcclusionResult = GL_FALSE; /* reset now */
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLdouble) ctx->OcclusionResult;
+ else
+ *params = (GLdouble) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
@@ -2980,8 +2990,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
return;
case GL_OCCLUSION_TEST_RESULT_HP:
if (ctx->Extensions.HaveHpOcclusionTest) {
- *params = (GLfloat) ctx->OcclusionResult;
- ctx->OcclusionResult = GL_FALSE; /* reset now */
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLfloat) ctx->OcclusionResult;
+ else
+ *params = (GLfloat) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
@@ -3967,8 +3982,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
return;
case GL_OCCLUSION_TEST_RESULT_HP:
if (ctx->Extensions.HaveHpOcclusionTest) {
- *params = (GLint) ctx->OcclusionResult;
- ctx->OcclusionResult = GL_FALSE; /* reset now */
+ if (ctx->Depth.OcclusionTest)
+ *params = (GLint) ctx->OcclusionResult;
+ else
+ *params = (GLint) ctx->OcclusionResultSaved;
+ /* reset flag now */
+ ctx->OcclusionResult = GL_FALSE;
+ ctx->OcclusionResultSaved = GL_FALSE;
}
else {
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );