DirectDrawThe DirectDraw component is important, as many of its features are used either directly or indirectly by the Direct3D component of DirectX. The DirectDraw component is implemented in hardware and software. DirectDraw is the only client of the DirectDraw hardware abstraction layer (HAL). The HAL protects the application from the differences of the different hardware. Applications using DirectDraw only communicate with DirectDraw and cannot access the HAL directly or indirectly. DirectDraw improves performance by providing support for 2D functions of the applications. It provides direct access to the off screen bitmaps, making access faster. It also provides fast access to a blitting (bit block transfer) and buffer flipping. Some of the other features include support for transparent blitting and support for overlays, for implementing sprites and managing multiple layers of animation. All these features help in drastically improving the performance of the Windows applications as compared to Windows applications written without such support. DirectDraw ObjectsAn application using DirectDraw, uses two objects, namely DirectDraw and DirectDrawSurface. The DirectDraw object represents the display adapter card. The DirectDrawSufrace object represents the display memory, on which the data to be displayed is rendered. Applications can also make use of additional objectsm like DirectDrawPalette and DirectDrawClipper. Common UsageA standard method of using DirectDraw is given below:
|
|||||||||||
![]() |