aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
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/get.c
parent941dcc797e1a6317808c1ec43476817286d576ba (diff)
more GL_HP_occlusion_test work
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c38
1 files changed, 29 insertions, 9 deletions
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" );