HP Workstation zx2000 HP OpenGL Implementation Guide for HP-UX 11.X (IPF versi - Page 19
glColorMaskGL_FALSE, GL_FALSE, GL_TRUE
View all HP Workstation zx2000 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 19 highlights
overview of OpenGL The following is a sample code segment of how the visibility test extension might be used. #define NUMTESTS 1000 GLboolean visBuffer[NUMTESTS], visstuff[2]; glVisibilityBufferHP(NUMTESTS,visBuffer,GL_TRUE); glEnable(GL_VISIBILITY_TEST_HP); // We don't actually want to touch the Color or Depth buffers... glDepthMask(GL_FALSE); glColorMask(GL_FALSE, GL_FALSE,GL_FALSE,GL_FALSE); for ( [Each object to be tested] ) {
OpenGL implementation guide
1–15
overview of OpenGL
The following is a sample code segment of how the visibility test extension might be used.
#define NUMTESTS 1000
GLboolean
visBuffer[NUMTESTS],
visstuff[2];
glVisibilityBufferHP(NUMTESTS,visBuffer,GL_TRUE);
glEnable(GL_VISIBILITY_TEST_HP);
// We don't actually want to touch the Color or Depth buffers...
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE, GL_FALSE,GL_FALSE,GL_FALSE);
for ( [Each object to be tested] )
{
<Render Object's bounding box>
// Move on to the next test
glNextVisibilityTestHP();
}
glDisable(GL_VISIBILITY_TEST_HP);
glGetBooleanv(GL_VISIBILITY_TEST_HP, visstuff);
// Turn these back on for rendering the objects
glDepthMask(GL_TRUE);
glColorMask(GL_TRUE, GL_TRUE,GL_TRUE,GL_TRUE);
for ( i=0; i < [Num Objects Tested] )
{
if (visBuffer[i] )
{
[ Render the ith Object ]
}
}