PDA

View Full Version : How to draw two areas independently!



davie
07-06-2010, 11:46 PM
Hi there,

I want to do the following:
1. Show the current time(ie. 20:35:40) on the screen. so i need update region A of my screen every second.
2. move a icon follow the mouse. so when the mouse moving, i need update region B of my screen too.

but there is a problem, when i draw the current time, i think i only need redraw region A of my screen, not all of it. Moving a icon is the same, but region B. but the glClear function clears all my screen every time. What i need is as follow:

if time changed:
clear region A;
draw current time at region A;
if mouse moving:
clear region B;
draw icon at region B;

Is there a function clears some regions of screen? not clear all the screen. I think the two actions should not affect each other. Thanks a lot!