gedi::Mouse Class Reference

#include <Mouse.h>

Inherited by gedi::MouseState.

Inheritance diagram for gedi::Mouse:

[legend]
List of all members.

Public Member Functions

 Mouse (void)
 ~Mouse (void)
gedi::Error32 Init (HWND hWindow)
gedi::Error32 Update (void)
gedi::Bool32 IsButtonDown (gedi::UInt32 iButton)
gedi::Bool32 IsButtonUp (gedi::UInt32 iButton)
gedi::UInt32 GetXAxis (void)
gedi::UInt32 GetYAxis (void)
gedi::Error32 Clear (void)

Protected Attributes

LPDIRECTINPUTDEVICE8 m_lpkDIDevice
DIDEVICEOBJECTDATA m_akDeviceData [MR_MOUSE_DATASIZ]

Detailed Description

This class wraps the DirectX mouse device.


Constructor & Destructor Documentation

gedi::Mouse::Mouse ( void   ) 

Constructor.

gedi::Mouse::~Mouse ( void   ) 

Destructor.


Member Function Documentation

gedi::Error32 gedi::Mouse::Init ( HWND  hWindow  ) 

Initializes DirectX.

Parameters:
hWindow Window instance.

gedi::Error32 gedi::Mouse::Update ( void   ) 

Update the device state, called each cycle of game loop.

gedi::Bool32 gedi::Mouse::IsButtonDown ( gedi::UInt32  iButton  ) 

Returns true if button is pressed down.

Parameters:
iButton Button number (0-3), left button being 0.
Returns:
gedi::True if button pressed, gedi::False otherwise.

gedi::Bool32 gedi::Mouse::IsButtonUp ( gedi::UInt32  iButton  ) 

Returns true if button is NOT pressed down.

Parameters:
iButton Button number (0-3), left button being 0.
Returns:
gedi::True if button NOT pressed, gedi::False otherwise.

gedi::UInt32 gedi::Mouse::GetXAxis ( void   ) 

Return the absolute X coordinate of mouse.

Returns:
X coordinate of mouse.

gedi::UInt32 gedi::Mouse::GetYAxis ( void   ) 

Return the absolute Y coordinate of mouse.

Returns:
Y coordinate of mouse.

gedi::Error32 gedi::Mouse::Clear ( void   ) 

Clears the device data buffer.

Returns:
gedi::NoError if no error, gedi::ErrorMouseGetDeviceData otherwise.


Member Data Documentation

LPDIRECTINPUTDEVICE8 gedi::Mouse::m_lpkDIDevice [protected]

DirectInput object

DIDEVICEOBJECTDATA gedi::Mouse::m_akDeviceData[MR_MOUSE_DATASIZ] [protected]

DirectInput input data


The documentation for this class was generated from the following files: