Avoiding drawings from one device context from overwriting another one?
First, I've got 2 separate device contexts to draw on, they are both static images. However, one of them is going to be moved around. As usual, these 2 device contexts is updated on a game loop,
the "moving" device context is underneath the "static" context above it, but as the game loop is running so fast, it begins to flicker.
So currently, I am drawing these 2 device contexts into a final context, and I blit out the final context every frame. But it still flickers, any ideas how I can fix this?
If I have already used the "final" context when doing the blitting, am I already using a double-buffering technique?
thanks
Jack
Re: Avoiding drawings from one device context from overwriting another one?
You should look into memory device context.
Prepare your entire frame in a memory device context, then blit that one to the screen.
The result is flicker-free animation.