LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Cornix on June 08, 2013, 14:17:08

Title: glClear only in a limited area
Post by: Cornix on June 08, 2013, 14:17:08
Is it possible? To clear the depth buffer bit or the color buffer bit only within a certain rectangle?

Thanks for the help.
Title: Re: glClear only in a limited area
Post by: quew8 on June 08, 2013, 15:00:26
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.
Title: Re: glClear only in a limited area
Post by: Cornix on June 08, 2013, 18:50:46
Wow, didnt know that scissor test did that!
Thank you a bunch!