Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
35 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 DirectX
 DirectDraw
 Direct3D
 Rendering Engine
 File Format
 DirectX and COM
 Summary and
 Appendix


 Printable version

 


DirectDraw

The 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 Objects

An 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 Usage

A standard method of using DirectDraw is given below:

  1. Create the front buffer and back buffer (to exchange the images)
  2. Images to be displayed are written to the back buffer, instead of directly to the screen
  3. At the end of drawing, the screen is updated by flipping the back and the front buffers. After this flipping operation, the back buffer becomes the current front buffer while the front buffer becomes the current back buffer



Next : Direct3D