Jump to content
  • Advertisement
Sign in to follow this  
supagu

debugging stencil

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

im working on some stencil code for my games UI. I've got this problem where most thigns work but the occasional button or what ever doesnt render. Are there any methods to view the stencil buffer so i can see whats going on? or other methods to debug such problems?

Share this post


Link to post
Share on other sites
Advertisement
after your stencil-renderpart. (to only condition is that this is done outside of glBegin)

use glReadPixels(0,0,viewport_x,viewport_y,GL_STENCIL_INDEX,GL_UNSIGNED_BYTE,data);
to visualize the result you can use:
glDrawPixels(viewport_x,viewport_y,GL_STENCIL_INDEX,GL_UNSIGNED_BYTE,data);

it will be very slow but you will be able to see whats going on. if you dont see anything try putting a glFlush before glReadPixels.

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!