HP Workstation zx2000 HP OpenGL Implementation Guide for HP-UX 11.X (IPF versi - Page 19

glColorMaskGL_FALSE, GL_FALSE, GL_TRUE

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] ) {

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42

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 ]
}
}