In Brief

We've covered the bare essentials for getting a triangle rendered, and then included code to make it spin around and get it lit inside our scene. In doing so, we've accomplished the following:

  • Created a Direct3D device attached to our windows form

  • Rendered a single colored triangle in our window

  • Rotated our triangle around our scene

  • Introduced a simple light to our scene

Compiling the code will show a window that looks much like Figure 1.7.

Figure 1.7. Spinning 3D triangle.

In our next chapter we'll look at how we can find out which options our device can support, and create our devices accordingly.

Get Managed DirectX® 9 Kick Start: Graphics and Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.