PDA

View Full Version : Is there a way to cut a part of the screen?



fandecine
10-10-2002, 10:05 AM
Hi!
I would like to draw a rectangle on the screen that will delete everything inside. For example if I draw a red square on my screen and then draw a smaller rectangle inside, it will cut it and appears like the rest of the screen. I use the GLUT library. Any help would be appreciated.
Thanks!
LD

Deiussum
10-10-2002, 11:39 AM
You should be able to do what you want with the stencil buffer. Basic steps would be

1) Draw your small rectangle to the stencil buffer
2) Enable the propery stencil test and draw your big rectangle.