Clearing part of the screen?


I’m looking for the best way to clean part of the screen. My scene is restricted to the bottom left corner of the screen, as I have menus top and right that almost never change, and that I don’t want to redraw every frame.

The problem is, glClear() ignores the current viewport. I’ve tryed as well with the stencil buffer, but it’s ignored as well, all the screen gets cleared.

Shall I just paint a black polygon that totaly cover my scene? Or turn manualy every pixel of my viewport in the framebuffer to black?

Thanks for any advice :slight_smile:

You can use the scissor test to limit the area affected by glClear.

That’s exactly what I was looking for, thanks!