|
Re: InvalidateRect???
Another thing besides double buffering is proper use of InvalidateRect(). The purpose of this function is to invalidate (ie mark as not up-to-date) a rectangle within your window. As such, if you pass the entire window (or more precisely, the entire client area), you will get more flicker than if you invalidate the smallest region possible.
With something like your game, it should only be updating a small region (about 1/16th of the client area) with each move, and this will probably lead to less flicker. Even if you get the flicker issue solved with double buffering, you should do this; it doesn't make sense to blit sixteen times the pixels you need to.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
|