DirectXVisual Studio .NET 2002Visual Studio 6Visual C++ 7.0Windows 2000Visual C++ 6.0Windows XPMFCIntermediateDevVisual StudioWindowsC++
Drawing with DirectDraw & GDI






4.88/5 (10 votes)
May 25, 2002

303838

13875
Drawing Graphics fast with DirectDraw than with GDI
Software required to build the project:
- Visual C++ 6.0
- Direct X 7.0 SDK
Software required to run the Demo:
- DirectX 7.0
- Windows 2000 or Win 9x
- The system color must be 32 bits
Introduction
Drawing is a DLL to develop graphics software and games. You can use it to display standard image formats (BMP, Jpeg, Png, tiff...). Also you can draw normal graphics (line, circle, rectangle...) with it. Drawing has a trait that change the draw engine at any moment. You can draw something with DirectDraw or GDI, certainly DirectDraw is faster and better than GDI.
The code
Drawing DLL consists of the following classes:
CCanvas
CCanvasImpl
CDDCanvasImpl
CGDICanvasImpl
NDDSCreen
NDDSurface
CMemDC
Drawing DLL class structure:
Note
When you use Drawing DLL, you can Create a CCanvas
object and do your drawing work with it.
At last you use canvas.refresh()
to draw the screen.