DirectXTutorial.com
The Ultimate DirectX Tutorial
Game Input
Log In
Prerequisite

Before you can do this tutorial, you will need the following:

1.  Visual Studio 2005 (or Visual C++ 2005 Express Edition)*.
2.  A knowledge of basic C++ and Win32 programming.
3.  A burning desire to make games.

* - other versions of C++ compilers will also run DirectX, however, there are some language specific changes you may need to make in each of the demo applications.

Lesson 1:  Simple Input

Important to every game is input.  In this lesson, we'll cover simple methods to get keyboard and mouse data from the computer.

Lesson 2:  Raw Mouse Input

For game input, an alternate method, frequently used by professionals, is the Raw Input API.  This API is designed to give input directly from the input devices themselves.  To that end, it naturally provides mouse motion instead of mouse position, and it doesn't do anything to filter keyboard information.  In this lesson, we'll cover the basics of this API.

Lesson 3:  Managing Mouse Pointers

This lesson has not been written yet.

Lesson 4:  V-Sync and Mouse Lag

This is a short theory lesson.  In here we'll cover what V-Sync is, what it has to do with the mouse, and what it's advantages and disadvantages are.  We'll also cover how to enable and disable it in your game.

Lesson 5:  Picking in Direct3D

It's good that you can find the location of a mouse pointer and maybe even render your own, but once you've clicked, what did you just click on?  There is no simple way of figuring out where in the 3D world your mouse is currently over.  However, there are a few simple tricks using Direct3D which can make things a lot easier.