stephanh
01-12-2004, 05:28 AM
Hi,
when using ARB_occlusion_query or NV_occlusion_query i get a GL Error (Invalid Operands) at the line where the queries' results are retrieved. I used the code example in the ARB/NV extension spec as a guideline but i cannot find anything wrong in the code.
Any idea/hints?
Thank you very much in advance.
regards,
Stephan
if( !GLEW_NV_occlusion_query ) return;
glDepthFunc( GL_LEQUAL );
glDisable( GL_TEXTURE_2D );
Point3D vPt;
glPointSize( 64.0f );
int i=0;
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glDepthMask(GL_FALSE);
for( float fAng = 0.0f; fAng < PI*2.0f, i < 8; fAng += 0.25*PI, i++ )
{
vPt = vRight_ * sin(fAng) * fSize_ + vUp_ * cos(fAng) *fSize_ + vCurrentSunPos_;
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glDepthMask(GL_FALSE);
braucht!.
assert( 1+i < 9 );
glBeginOcclusionQueryNV( uiOcclusionQuery_[1+i] );
glBegin(GL_POINTS);
glVertex3f( vPt.x, vPt.y, vPt.z );
glEnd();
glEndOcclusionQueryNV();
}
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDepthMask(GL_TRUE);
for(int i=1; i < 9; i++ )
{
// SKip the [0] result for now!
glGetOcclusionQueryuivNV( uiOcclusionQuery_[i], GL_PIXEL_COUNT_NV,&uiVisibility_[i]);
}
[This message has been edited by stephanh (edited 01-12-2004).]
when using ARB_occlusion_query or NV_occlusion_query i get a GL Error (Invalid Operands) at the line where the queries' results are retrieved. I used the code example in the ARB/NV extension spec as a guideline but i cannot find anything wrong in the code.
Any idea/hints?
Thank you very much in advance.
regards,
Stephan
if( !GLEW_NV_occlusion_query ) return;
glDepthFunc( GL_LEQUAL );
glDisable( GL_TEXTURE_2D );
Point3D vPt;
glPointSize( 64.0f );
int i=0;
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glDepthMask(GL_FALSE);
for( float fAng = 0.0f; fAng < PI*2.0f, i < 8; fAng += 0.25*PI, i++ )
{
vPt = vRight_ * sin(fAng) * fSize_ + vUp_ * cos(fAng) *fSize_ + vCurrentSunPos_;
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE); glDepthMask(GL_FALSE);
braucht!.
assert( 1+i < 9 );
glBeginOcclusionQueryNV( uiOcclusionQuery_[1+i] );
glBegin(GL_POINTS);
glVertex3f( vPt.x, vPt.y, vPt.z );
glEnd();
glEndOcclusionQueryNV();
}
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDepthMask(GL_TRUE);
for(int i=1; i < 9; i++ )
{
// SKip the [0] result for now!
glGetOcclusionQueryuivNV( uiOcclusionQuery_[i], GL_PIXEL_COUNT_NV,&uiVisibility_[i]);
}
[This message has been edited by stephanh (edited 01-12-2004).]