Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GameDXInput Class Reference

GameDXInput A wrapper class for Direct Input. More...

#include <GameDXInput.h>

List of all members.

Public Methods

 GameDXInput ()
 Constructor sets all member variables to 0.

 ~GameDXInput ()
 Destructor calls DITerm.

void DITerm ()
 DITerm.

void SetupDI (HINSTANCE hInstance, HWND hwndMain)
 SetupDI.

void PollKeyboard ()
 Polls the keyboard to update the key buffer.

bool IsKeyDown (int keyToCheck)
 Checks the key buffer if specified key has been pressed.

void PollMouse ()
 MousePoll.

bool IsButtonDown (int Button)
 IsButtonDown.

POINT GetScreenPt ()
 GetMousePt.

POINT GetRelativePt ()
 GetRelativePt.

POINT GameDXInput::GetWindowPt ()
 Currently the mouse window pt is not set, so this function gets garbage.

void ResetPos ()
 Resets Position to 0,0.

void CenterPos ()
 Centers position to center of window.

void CreateMouseSurf (LPDIRECT3DDEVICE8 m_pd3dDevice, char *pathName)
 Creates mouse surface.

void ShowCursor (bool bShow, LPDIRECT3DDEVICE8 device)
 Turn on/off show cursor.

void OnLostDevice ()
 Event called when device is lost.

void OnResetDevice ()
 Event called when device is reset.


Detailed Description

GameDXInput A wrapper class for Direct Input.

Handles creating and managing a DirectInput object. Both keyboard and mouse input are done through this object.


Member Function Documentation

void GameDXInput::CreateMouseSurf LPDIRECT3DDEVICE8    m_pd3dDevice,
char *    pathName
 

Creates mouse surface.

Parameters: pd3dDevice - Initialized Display Device

void GameDXInput::DITerm  
 

DITerm.

Cleans up all the DirectInput pointers

POINT GameDXInput::GetRelativePt  
 

GetRelativePt.

Returns:
relative point of x, y movement
Precondition:
PollMouse was called

POINT GameDXInput::GetScreenPt  
 

GetMousePt.

Returns:
the mouses X,Y position
Precondition:
PollMouse was called

bool GameDXInput::IsButtonDown int    Button
 

IsButtonDown.

Returns:
true if the passed button is down
Precondition:
PollMouse was called to poll the mouse for input

bool GameDXInput::IsKeyDown int    keyToCheck
 

Checks the key buffer if specified key has been pressed.

Parameters:
keyToCheck  specified key to check
Precondition:
PollKeyboard has been called to set the key buffer
Returns:
true if key is down

void GameDXInput::PollMouse  
 

MousePoll.

Polls the mouse to update all the current info about it

void GameDXInput::SetupDI HINSTANCE    hInstance,
HWND    hwndMain
 

SetupDI.

Setups a DirectInput Object and ties it to the keyboard

Parameters:
hInstance  the HINSTANCE
hwndMain  the main HWND


The documentation for this class was generated from the following files:
Generated on Wed May 14 01:38:08 2003 for CG Skeletal Animation Project by doxygen1.2.18