Last modified on 23 September 2012, at 12:28

DirectX

DirectX is a Windows hardware abstraction. It's primarily known for it's use in graphics; however it has many other applications, as it was made with media and entertainment in mind. To program with DirectX, you need to understand its basic layout. First of all, DirectX is a group of components; including Direct3D, DirectDraw, DirectSound, and DirectInput. Most of these components have been depreciated and are no longer developed because they are simply wrappers for Win32 functions. However, they still have their uses.

Prerequisites

Learning to program with DirectX is hard. That being said, I will explain what is required and expected of you by this book.

First and foremost - you must have the DirectX libraries installed. These may be distributed with compilers, or, if you use one, the IDE (basic DirectX functionality is generally provided with Windows IDEs). If you don’t have these libraries, or want more recent distributions, you can obtain the SDK here: http://www.microsoft.com/downloads/details.aspx?FamilyID=4b78a58a-e672-4b83-a28e-72b5e93bd60a&DisplayLang=en This is a very large development kit (400 MB), complete with examples and useful utilities.

Secondly - You must know a language that can link with C++ libraries. Most native languages and several managed languages can do this, but it's easiest if you can just use C++. This book will not go over basic programming concepts, or even some of the advanced concepts which are frequently used by DirectX, such as pointers and abstract classes. Don't come back without knowing these, or you won't understand what we're doing or why we're doing it. The DirectX 9 book does not cover Window creating or message handling.

Layout

DirectX is not one single program or library. DirectX is a group of components which are independently developed. To list a few, these include Direct3D, DirectDraw, and DirectMusic. These components provide access to a software interface for communicating with the hardware with a Component Object Model (COM) library. This wikibook will be designed around that concept and split into a section for each version and component. Some of these components are updated regularly (such as Direct3D), so there will be a section for each version. The ones which are depreciated will be listed under the last version that they were upgraded.

That said, now we can begin to learn how to program with DirectX.

Sections

DirectX 9.0

DirectX 10.0/11.0