• Advertisement
Sign in to follow this  

how to use GL_NV_occlusion_query in program ?

This topic is 4651 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I try to use this NVIDIA extension library, my display screen is crash.... I follow its rough sample code to write, but it can't work( build is ok ) Perhaps I lost something ? I can't figure out. >"< Could someone teach me how to write this ? According to his rough sample code, I know how to complete it. But it can't work.... >"< Here is his rough sample code. GLuint occlusionQueries[N]; GLuint pixelCount; glGenOcclusionQueriesNV(N, occlusionQueries); // It works here and crash, don't know what happened >"< // My card support glGenOcclusionQueriesNV() ... // before this point, render major occluders glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); glDepthMask(GL_FALSE); // also disable texturing and any fancy shading features for (i = 0; i < N; i++) { glBeginOcclusionQueryNV(occlusionQueries); // render bounding box for object i glEndOcclusionQueryNV(); } // at this point, if possible, go and do some other computation glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask(GL_TRUE); // reenable other state for (i = 0; i < N; i++) { glGetOcclusionQueryuivNV(occlusionQueries, GL_PIXEL_COUNT_NV, &pixelCount); if (pixelCount > 0) { // render object i } }

Share this post


Link to post
Share on other sites
Advertisement
-Did you initialize the extension functions?
-Did you check for any gl-errors
-You should be using GL_ARB_occlusion_query

Share this post


Link to post
Share on other sites
-Did you initialize the extension functions?

I initialize the extension functions. I copy glew.h , glew.lib , glew.dll to related directionary.

-Did you check for any gl-errors

After I compiled, nothing were wrong.

-You should be using GL_ARB_occlusion_query

My coding is not good. Could you tell me why I am using GL_ARB_occlusion_query ? I think that the reason might be my coding skill. = ="

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement