summaryrefslogtreecommitdiffstats
path: root/progs/demos/osdemo.c
diff options
context:
space:
mode:
authorRandy Frank <[email protected]>2000-03-28 16:59:39 +0000
committerRandy Frank <[email protected]>2000-03-28 16:59:39 +0000
commit23ee049401fdaaa77240a3eb02ca4dcce421a939 (patch)
tree7ea0026303b73f22234a5708c0b2b385242ab5c6 /progs/demos/osdemo.c
parent9d4d85520834361af3797c720c1b9b223f083d59 (diff)
Implemented support for the HP occlusion test extension (osmesa and X)
Diffstat (limited to 'progs/demos/osdemo.c')
-rw-r--r--progs/demos/osdemo.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/progs/demos/osdemo.c b/progs/demos/osdemo.c
index 83f29af0703..7411d4ad4e0 100644
--- a/progs/demos/osdemo.c
+++ b/progs/demos/osdemo.c
@@ -1,4 +1,4 @@
-/* $Id: osdemo.c,v 1.3 2000/03/06 23:56:21 brianp Exp $ */
+/* $Id: osdemo.c,v 1.4 2000/03/28 16:59:39 rjfrank Exp $ */
/*
* Demo of off-screen Mesa rendering
@@ -75,24 +75,26 @@ static void render_image( void )
glutSolidCone(1.0, 2.0, 16, 1);
glPopMatrix();
-#ifdef OSMESA_OCCLUSION_TEST_RESULT_HP
+#ifdef GL_HP_occlusion_test
{
GLboolean bRet;
- OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet);
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
+ glEnable(GL_OCCLUSION_TEST_HP);
+ glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
glPushMatrix();
- glTranslatef(0.75, 0.0, -1.0);
+ glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(1.0, 20, 20);
glPopMatrix();
- OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet);
+ glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
printf("Occlusion test 1 (result should be 1): %d\n",bRet);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
+ glDisable(GL_OCCLUSION_TEST_HP);
}
#endif
@@ -102,26 +104,28 @@ static void render_image( void )
glutSolidSphere(1.0, 20, 20);
glPopMatrix();
-#ifdef OSMESA_OCCLUSION_TEST_RESULT_HP
+#ifdef GL_HP_occlusion_test
{
GLboolean bRet;
- OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet);
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
+ glEnable(GL_OCCLUSION_TEST_HP);
+ glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
/* draw a sphere inside the previous sphere */
glPushMatrix();
- glTranslatef(0.75, 0.0, -1.0);
+ glTranslatef(0.75, 0.0, -1.0);
glMaterialfv( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue_mat );
glutSolidSphere(0.5, 20, 20);
glPopMatrix();
- OSMesaGetBooleanv(OSMESA_OCCLUSION_TEST_RESULT_HP,&bRet);
+ glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP,&bRet);
printf("Occlusion test 2 (result should be 0): %d\n",bRet);
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
+ glDisable(GL_OCCLUSION_TEST_HP);
}
#endif