Hi I submitted a bug report a few days ago concerning the HP_OCCLUSION_TEST
extention to opengl on the tdfx driver.
Im hopefully gonna fix it myself, but i was wondering if any one can verify that
the extension works perfectly on any other (other than the v5500) voodoo card.
The bug report ID is 469331, there is a simple glut program to test it.
I have attach the prog to this email too. If you cant see the white square or
it flickers/blinks the extension is failing (well the glide register read
anyhow)
Any feedback wil be greatly appreciated.
Thanks.
--
- | TheBentos | -
The Moon is Waning Crescent (34% of full)
#include <GL/gl.h>
#include <GL/glut.h>
#define NULL (void*)0
GLfloat rot = 0.0f;
void draw(void)
{
glBegin(GL_QUADS);
glVertex3f(-1.0f, 1.0f, 0.0f);
glVertex3f(1.0f, 1.0f, 0.0f);
glVertex3f(1.0f, -1.0f, 0.0f);
glVertex3f(-1.0f, -1.0f, 0.0f);
glEnd();
}
void display(void)
{
GLboolean result = GL_TRUE;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -2.0f);
glRotatef(rot, 0.0f, 1.0f, 0.0f);
glColor3f(1.0f, 0.0f, 1.0f);
draw();
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glDepthMask(GL_FALSE);
glEnable(GL_OCCLUSION_TEST_HP);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -4.0f);
glColor3f(1.0f, 1.0f, 1.0f);
draw();
glGetBooleanv(GL_OCCLUSION_TEST_RESULT_HP, &result);
glDisable(GL_OCCLUSION_TEST_HP);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
printf("%d\n", result);
if (result == GL_TRUE)
{
draw();
}
rot += 0.5f;
glutSwapBuffers();
}
void visible(int state)
{
glutIdleFunc((state == GLUT_VISIBLE ? glutPostRedisplay : NULL));
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutCreateWindow("HP_occlusion_test");
glutDisplayFunc(display);
glutVisibilityFunc(visible);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0f);
glMatrixMode(GL_PROJECTION);
gluPerspective(90.0,1.0, 1.0, 10.0);
glMatrixMode(GL_MODELVIEW);
gluLookAt(0.0, 0.0, 5.0,
0.0, 0.0, 0.0,
0.0, 1.0, 0.);
glutMainLoop();
return 0;
}