double-buffer of GDI
GDI is not a good choice for Game development for its efficiency. But for some simple 2D game, GDI is enough.
The biggest problem for game dev in GDI is screen blink. if we draw picture/graphic figure in screen directly, the figures will be draw out step by step. if there are too many graphic figures or the drawing is implemented frequently, the screen will blink.
Is there a way to solve this problem? yes, double-buffer will help you.
To implement doubl-buffer in GDI, you can follow these steps:
1)Create a compatible
{
::PostQuitMessage(0);
}
2)CreateCompatibleBitmap
3)Select Bitmap into dc
4) Copy the bitmap to screen
refered to :http://www.vckbase.com/document/viewdoc/?id=1612