glClear only in a limited area

Started by Cornix, June 08, 2013, 14:17:08

Previous topic - Next topic

Cornix

Is it possible? To clear the depth buffer bit or the color buffer bit only within a certain rectangle?

Thanks for the help.

quew8

The scissor test affects glClear. so glEnable(GL_SCISSOR_TEST); and glScissor(x, y, width, height); All measurements are in pixels. After this, all calls to glClear will only clear the area in the scissor box. Remember to disable it again afterwards.

Cornix

Wow, didnt know that scissor test did that!
Thank you a bunch!