Tutorial 1: Rendering a Single Triangle

To use Direct3D, you first create an application window, then create and initialize DirectDraw® and Direct3D-related objects. You use the COM interfaces that these objects implement to manipulate them and to create the subordinate objects required to render a scene. The Triangle sample project upon which this tutorial is based illustrates these tasks by rendering the simplest possible scene: a single triangle. The Triangle sample uses the following steps to set up Direct3D, render a scene, and eventually shut down:

In addition to these steps, Triangle performs some standard tasks common to windowed applications. Although these tasks aren't difficult, the Triangle sample (and all other windowed samples) performs the following tasks as the needed: