PDA

View Full Version : How to redraw some objects while not redraw others?



ding
09-27-2002, 10:27 PM
I can redraw only some objects within the update region using InvalidateRect( LPCRECT lpRect, BOOL bErase = TRUE ).
But sometime I can't completely separate the objects based on region.For example, when I draw a hill, trees, and some snow,
I wish redraw snow with time, but it's not necessary to redraw the hill and trees.

How do I do?

thanks!

student

mikael_aronsson
09-27-2002, 11:09 PM
Hi !

With OpenGL you always have to redraw the entire window contents when some part of the window is invalidated.

Mikael

jwatte
09-28-2002, 09:25 AM
For the snowfall case, you can render the geometry to an offscreen buffer (back buffer or pbuffer) and blit to the screen to display it; then render the snow to the front buffer. Just don't write the depth buffer and you'll be fine.

However, in general, most interactive 3D applications re-render the entire scene each frame.