View Full Version : glClear and viewport
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?
08-25-2005, 05:49 AM
try glScissor() and don't forget to enable scissor test.
What about RTFM for glClear ?
08-26-2005, 05:44 AM
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?
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...
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.