-
September 17th, 2018, 11:34 PM
#1
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
-
October 28th, 2018, 08:55 AM
#2
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|