The DirectX Components
The DirectX architecture is made up of many components. You can work with 3D graphics by way of Direct3D. DirectDraw gives you access to many of the animation technologies used in the game industry for decades. DirectInput enables you to understand user input from the keyboard, mouse, and joystick devices. DirectMusic and DirectSound give you access to the sound used in games today. Network capabilities, which are popular in many of today's games, come to you in DirectPlay. DirectX has not forgotten about ease of setup, either, so DirectSetup, which supplies an easy-to-install interface for DirectX, is included with the other DirectX components. Figure 1.7 shows a hierarchical layout of all the components that make up DirectX.
Figure 1.7 An architectural overview of the DirectX object model.
For those of you who love 3D animations, Direct3D is a fantastic addition to DirectX. With Direct3D, you can use DirectX to create complex 3D graphics on hardware that supports 3D rendering. The Direct3D component includes lighting effects, materials, and shading. Direct3D is also referred to as the DirectX Graphics component.
DirectDraw is the heart and soul of DirectX 2D graphics, giving you many of the features needed for basic animation, such as blitting, clipping, and flipping. DirectDraw provides the methods for developers to talk directly to the graphics hardware without having to learn how each piece of hardware works. It allows for complete hardware independence.
DirectInput enables the developer to open up communication with the input devices needed in computer games and multimedia. DirectInput supports keyboard, mouse, and joystick devices. DirectInput can also control the features of ForceFeedback devices, such as the Microsoft SideWinder Force Feedback game controller.
If your program needs music, then DirectMusic is for you. DirectMusic offers complex composition abilities as well as complete playback for multimedia applications. You can also add Direct Music soundtracks to multimedia applications to make them more appealing to users.
Network games and applications are becoming an essential part of the game genre. To that end, DirectX has a component called DirectPlay that provides easy network access to your games. DirectPlay supports Lobbies, Messaging, and Management. It also supports TCP/IP, internetwork packet exchange (IPX), modems, and serial connections. With this technology, developers can take their games to the Net quickly and easily. This technology can also be used to create messaging applications similar to MSN Messenger Service or AOL's Instant Messenger.
DirectSetup enables you to easily distribute DirectX with your application. With this component, your application can be packaged into a nice neat setup; when it's installed, all the libraries and support files are there where the user needs them.
Sound is what makes a game seem more realistic, so the more realistic the sound, the better the game. DirectSound provides mixing, hardware acceleration, and direct access to the sound device. You can use this component to make car doors slam, horns honk, and birds chirp.