PDA

View Full Version : Not touching a portion of the screen.



Divide Overflow
08-14-2000, 02:02 AM
Hey everyone !

I want my application to not render to a certain part. ie.

|----------|-----|
| | A |
| B ------|
| |
|----------------|

A shouldn't be rendered. B should be rendered :-) Thanks !

--> Dividae

PS, yes, my Ascii art sucks :-)

BwB
08-14-2000, 02:26 AM
Hmm, if I understand that garbled mess correctly, you have a square in the upper right hand corner that doesnt get rendered right? Take a look at the stencil buffer (though thats not always available) or you can turn off writing to the color buffer and draw a square into the zbuffer (if your using one) that is at the closest depth (near plane), then turn the color buffer back on and draw the scene. Failing that (assuming you dont have a zbuffer) you could copy sqaure A into memory (read pixels) draw the scene and copy it back (draw pixels). I'm sure there are many other ways, but those sound like good places to start. Hope that helps!

-BwB

Relic
08-14-2000, 05:22 AM
Or set the subrectangles of area B (the two rects left and below of A) with glScissor() and draw the same image twice.
This also works for glClear() and preserves the z-Buffer contents of area A.

Saving and restoring areas may go quicker with GL_KTX_buffer_region than with glReadPixels and glDrawPixels.