There are two factors which produce flickering:

 

To remove this, we first make a bitmap, draw everything on this bitmap, and then paste this bitmap on the screen (without clearing the back ground). I have changed the code in Pang game. I have added two pointers in the CChildView class. They are:

CDC* m_pdcDisplayMemory;

CBitmap* m_pBitmap;

 

All the additional code is related to these pointers.

 

There are two major changes in the code that you should note:

 

Please remember that I have tried to keep the code simple, so the flickering is not removed perfectly. However, it should help most of you.

 

Pang Game with minimal Flickering