Tricks of the Windows Game Programming Gurus:Uplinking with DirectInput and Force Feedback

All ITKnowledge Source Code Search Tips Advanced Search |

| Tricks of the Windows Game Programming Gurus by Andre LaMothe Sams, Macmillan Computer Publishing ISBN: 0672313618 Pub Date: 09/27/99

Search this book:

Previous | Table of Contents | Next

#### The T3D Library at a Glance

At this point, you have two main `.CPP|H` modules that make up the T3D library:

  • `T3DLIB1.CPP|H`—DirectDraw plus graphics algorithms.
  • `T3DLIB2.CPP|H`—DirectInput.

Keep this in mind when you’re compiling programs. If you want to compile a demo program, call it `DEMOX_Y.CPP` and then look at its `.H` includes. If it includes either of the related `.H` library modules, you’ll obviously need to include the `.CPP` files too.

As an example of using the new library functions in `T3DLIB2.CPP|H`, I have rewritten the three demos created in this chapter, `DEMO9_1.CPP`, `DEMO9_2.CPP`, and `DEMO9_3.CPP`, as `DEMO9_1a.CPP`, `DEMO9_2a.CPP`, and `DEMO9_3a.CPP`, respectively. Therefore, you can see how much code can be chucked out when you use the library functions.

To compile any of the programs, make sure to include both of the library source files, as well as all of the DirectX `.LIB` files. And please, for God’s sake, set your compiler to Win32 `.EXE`. I have received over 30 emails today from people asking how to set the compiler! I’m a scientist, Jim, not a technical support agent for Microsoft!

### Summary

This chapter has been fairly fun, don’t you think? It covered DirectInput, keyboards, mice, joysticks, input data massaging, and a little force feedback, and you added another piece to your library. You learned that DirectX supports all input devices through a common interface, and there are just a few steps (all similar) to communicating with any device. Not bad, baby boy (or baby girl). However, you still aren’t out of the woods with the DirectX foundation systems. In the next chapter you’ll tackle DirectSound and a bit of DirectMusic. After that, you can get to some serious game programming!

Previous | Table of Contents | Next

Copyright © Macmillan Computer Publishing, Inc.

Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.