Managed DirectX First Steps: Direct 3D Basics and DirectX vs. GDI+
(Page 1 of 14 )
Have you ever wondered how to create graphics using DirectX? This article explains how to do it. It is taken from chapter three of the book
Beginning .NET Game Programming in C# by David Weller et. al. (Apress, 2004, ISBN: 1590593197).
DIRECTX REFERS TO A COLLECTION OF MICROSOFT-CREATED APIs and technologies that help developers more directly access the hardware features of a computer. It was originally released in 1996 as a way for game programmers to access the graphics hardware without requiring the developer to switch out of Windows and into DOS mode. Starting in 2002, Microsoft released a version of DirectX that allowed developers to access the DirectX libraries using .NET languages (such as C#, Visual Basic .NET, and managed C++), which is commonly referred to as Managed DirectX (Microsoft and developers often use the acronym MDX).
This chapter will take you on an introductory tour of the graphical components of DirectX and also teach you a few differences between graphics programming in DirectX and GDI+. We’ll follow a different approach from the other chapters though: There’ll be no sample game, and we’ll instead concentrate on the basic features of DirectX (particularly Direct3D) and how to go through its initialization routines, creating a sample application that will demonstrate each of these features.
The sample application, as you’ll see in the section “The Application Proposal,” will comprise a main window, which will display your 3-D board capabilities, and a set of separate windows that will each test a specific feature, like use of lights, 3-D transformations, and full-screen drawings. In each of these test windows we’ll present sequentially the drawings of a walking man, shown in Figure 3-1, providing the illusion of movement.

Figure 3-1. The working man, presented as this chapter's
sample application DirectX allows the programmer to access hardware devices, such as 3-D acceleration boards and advanced sound systems, using unified interfaces. Developers can take advantage of each hardware-specific feature to enhance the multimedia operation speed without having to worry about each device’s details. Think of DirectX as a set of high-level APIs for gaming, multimedia, and graphics programming.
The latest version of DirectX SDK can be downloaded from http://msdn.micro-soft.com/directx; this download includes the DirectX APIs, the Managed DirectX interfaces, the DirectX Software Development Kit (SDK), a comprehensive set of samples packaged in a nifty sample browser, and detailed documentation about all DirectX features.
In the next section, we’ll present an overview of DirectX that will give you enough information to go on exploring Direct3D features in the later sections.
This chapter is from Beginning .NET Game Programming in C# by David Weller et. al.(Apress, 2004, ISBN: 1590593197). Check it out at your favorite bookstore today. Buy this book now.
|
Next: DirectX Overview >>
More ASP.NET Articles
More By Apress Publishing