Jump to content
  • Advertisement
Sign in to follow this  

OpenGL glHistogram return always 0 values

This topic is 3074 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

Hello there, I've just tried out glHistogram (for some Computer Vision algorithm) and it turned out that I always get zero values returned from glGetHistogram. Here's the code snippet: <code> unsigned short histogram[3*256]; glEnable(GL_HISTOGRAM); while(render.Update(fTime)){ glDisable(GL_LIGHTING); // cylinder.DrawFaces(); glEnable(GL_HISTOGRAM); glHistogram(GL_HISTOGRAM, 256, GL_RGB, false); glResetHistogram(GL_HISTOGRAM); glColor3f(1.0,0.0,0.0); glBegin(GL_QUADS); glVertex3f(-0.2, -0.2, 0.0); glVertex3f( 0.2, -0.2, 0.0); glVertex3f( 0.2, 0.2, 0.0); glVertex3f(-0.2, 0.2, 0.0); glEnd(); glGetHistogram(GL_HISTOGRAM, true, GL_RGB, GL_UNSIGNED_SHORT, histogram); for(int j=0; j<3*256; j++) printf("%d ", histogram[j]); printf("\n"); glDisable(GL_HISTOGRAM); } </code> In the OpenGL Window I see the red square, but all the values in histogram are 0. (Note: if I remove the line glGetHistogram(...) the values are random/uninitialised as expected, so the 0 are written into 'histogram' by glGetHistogram(...)) Any ideas of what went wrong? Thanks! Tom

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!