Home | Site Map
Sunlight

DirectX

Introduction

In this tutorial, we will use our windowed program skeleton developed in the previous tutorial to build a DirectDraw program. We will learn techniques of full-screen DirectDraw applications, including bitmaps, sprites, page flipping and idle-time processing. We will go on to discuss DirectInput and DirectX Audio, and discuss proper error handling and co-operation with other applications. We will investigate the use of the new DirectX Graphics 3D API for 2D graphics. Finally, we will develop this into a framework you can use to build your own DirectX applications.

For the previous tutorial, the code was in C, compilable with a C++ compiler. This must now change. DirectX is accessible from C, but it's far quicker and easier to write in C++. I strongly recommend that you compile all DirectDraw code with a C++ compiler. Don't worry, there's nothing new to learn - we're just doing this to simplify the DirectX code. All the rest will remain in C.

You will need:

  • The DirectX 8 SDK, or the latest release of the Platform SDK, from Microsoft. Install the header files, libraries and sample programs.
  • DirectX version 8.
  • Windows 95, 98, ME, 2000 or XP. Sorry, but the newer DirectX versions (newer than 3!) don't function on Windows NT 4.

Download this tutorial in ZIP format (does not include code ZIP files).

Table of Contents