PDA

View Full Version : glClear and viewport



Boyana
08-25-2005, 05:43 AM
I need to draw on a particular part of the window. Setting the viewport to that part will draw the image in that part of the window but glClear still clears the whole window. How can I get glClear to clear only that portion of the window which is designated as the viewport?

Thank you!

Boyana

ZbuffeR
08-25-2005, 05:49 AM
try glScissor() and don't forget to enable scissor test.

What about RTFM for glClear ?
http://pyopengl.sourceforge.net/documentation/manual/glClear.3G.html

Boyana
08-26-2005, 05:44 AM
Thank you!

I tried with glScissor and glClear clears the scissor box with the given glClearColor but the whole window is still being painted with some kind of background color and all the interface (buttons, etc.) is being erased in the process. I guess I will have to update the whole window every time the rendering is being flushed out although the viewport occupies just a part of the window. Is there a way to avoid the whole window being painted every time the rendering is flushed out?

Thank you!

Boyana

CWiC
08-27-2005, 03:33 AM
What kind of framebuffer do you use - single or double buffered? In first case your task must be solved, if you use double buffering - you must redraw whole image each time you draw something...