25.5. A memory-based device context

In order to keep our rapidly animated Windows displays from flickering, we use the cMemoryDC objects as virtual windows, or memory bitmaps. It is not a standard MFC class like CPoint, nor is it a well-known kind of user-written class like cVector. cMemoryDC is a special memory device context class that the author implemented here in order to make Windows programming easier.

The cMemoryDC class is a child of the standard CDC class. This means that we can write to a cMemoryDC with the same graphics methods that the CDC class uses to put graphics into an onscreen window or onto a printer page. And because cMemoryDC is a kind of CDC, we can use the powerful CDC::BitBlt method to do extremely fast copying from ...

Get Software Engineering and Computer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.