-/* $Id: context.c,v 1.45 2000/03/06 17:03:03 brianp Exp $ */
+/* $Id: context.c,v 1.46 2000/03/11 23:23:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Depth.Clear = 1.0;
ctx->Depth.Func = GL_LESS;
ctx->Depth.Mask = GL_TRUE;
+ ctx->Depth.OcclusionTest = GL_FALSE;
/* Evaluators group */
ctx->Eval.Map1Color4 = GL_FALSE;
ctx->ErrorValue = (GLenum) GL_NO_ERROR;
ctx->CatchSignals = GL_TRUE;
+ ctx->OcclusionResult = GL_FALSE;
/* For debug/development only */
ctx->NoRaster = getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE;
-/* $Id: enable.c,v 1.11 2000/03/07 18:24:49 brianp Exp $ */
+/* $Id: enable.c,v 1.12 2000/03/11 23:23:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Array.EdgeFlag.Enabled = state;
break;
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ ctx->Depth.OcclusionTest = state;
+ ctx->NewState |= NEW_RASTER_OPS;
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, state ? "glEnable": "glDisable" );
+ return;
+ }
+ break;
+
default:
if (state) {
gl_error( ctx, GL_INVALID_ENUM, "glEnable" );
return ctx->Array.TexCoord[ctx->Array.ActiveTexture].Enabled;
case GL_EDGE_FLAG_ARRAY:
return ctx->Array.EdgeFlag.Enabled;
+
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ return ctx->Depth.OcclusionTest;
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
+ return GL_FALSE;
+ }
+
default:
gl_error( ctx, GL_INVALID_ENUM, "glIsEnabled" );
return GL_FALSE;
-/* $Id: extensions.c,v 1.19 2000/03/07 17:54:58 brianp Exp $ */
+/* $Id: extensions.c,v 1.20 2000/03/11 23:23:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
{ ALWAYS_ENABLED, "GL_ARB_tranpose_matrix" },
{ DEFAULT_OFF, "GL_EXT_vertex_array_set" },
{ DEFAULT_OFF, "GL_EXT_texture_env" },
- { DEFAULT_ON, "GL_EXT_texture_lod_bias" }
+ { DEFAULT_ON, "GL_EXT_texture_lod_bias" },
+ { DEFAULT_OFF, "GL_HP_occlusion_test" }
};
/* Update flags */
ctx->Extensions.HaveTextureEnvAdd = gl_extension_is_enabled(ctx, "GL_EXT_texture_env_add");
ctx->Extensions.HaveTextureLodBias = gl_extension_is_enabled(ctx, "GL_EXT_texture_lod_bias");
+ ctx->Extensions.HaveHpOcclusionTest = gl_extension_is_enabled(ctx, "GL_HP_occlusion_test");
}
-/* $Id: get.c,v 1.14 2000/02/24 22:04:03 brianp Exp $ */
+/* $Id: get.c,v 1.15 2000/03/11 23:23:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
break;
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = ctx->Depth.OcclusionTest;
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
+ }
+ return;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = ctx->OcclusionResult;
+ ctx->OcclusionResult = GL_FALSE; /* reset now */
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
+ }
+ return;
+
default:
- printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetBooleanv" );
}
}
}
break;
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = (GLdouble) ctx->Depth.OcclusionTest;
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
+ }
+ return;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = (GLdouble) ctx->OcclusionResult;
+ ctx->OcclusionResult = GL_FALSE; /* reset now */
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
+ }
+ return;
+
default:
- printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetDoublev" );
}
}
gl_matrix_transposef(params, ctx->TextureMatrix[texTransformUnit].m);
break;
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = (GLfloat) ctx->Depth.OcclusionTest;
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
+ }
+ return;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = (GLfloat) ctx->OcclusionResult;
+ ctx->OcclusionResult = GL_FALSE; /* reset now */
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
+ }
+ return;
+
default:
- printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetFloatv" );
}
}
}
break;
+ /* GL_HP_occlusion_test */
+ case GL_OCCLUSION_TEST_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = (GLint) ctx->Depth.OcclusionTest;
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
+ }
+ return;
+ case GL_OCCLUSION_TEST_RESULT_HP:
+ if (ctx->Extensions.HaveHpOcclusionTest) {
+ *params = (GLint) ctx->OcclusionResult;
+ ctx->OcclusionResult = GL_FALSE; /* reset now */
+ }
+ else {
+ gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
+ }
+ return;
+
default:
- printf("invalid enum: %x\n", pname);
gl_error( ctx, GL_INVALID_ENUM, "glGetIntegerv" );
}
}
-/* $Id: state.c,v 1.4 2000/02/24 22:04:03 brianp Exp $ */
+/* $Id: state.c,v 1.5 2000/03/11 23:23:26 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->RasterMask |= WINCLIP_BIT;
}
+ if (ctx->Depth.OcclusionTest) {
+ if (ctx->Color.ColorMask[0] == 0 &&
+ ctx->Color.ColorMask[1] == 0 &&
+ ctx->Color.ColorMask[2] == 0 &&
+ ctx->Color.ColorMask[3] == 0 &&
+ ctx->Depth.Mask == GL_FALSE &&
+ !ctx->Stencil.Enabled) {
+ ctx->RasterMask |= OCCLUSION_BIT;
+ }
+ }
+
/* If we're not drawing to exactly one color buffer set the
* MULTI_DRAW_BIT flag. Also set it if we're drawing to no
* buffers or the RGBA or CI mask disables all writes.
*/
-
ctx->TriangleCaps &= ~DD_MULTIDRAW;
if (ctx->Color.MultiDrawBuffer) {