Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

CMouse Class Reference

Mouse Device class. More...

#include <Mouse.h>

Inheritance diagram for CMouse:

CInputDevice CInputDeviceState CEntity List of all members.

Public Member Functions

bool IsButtonDown (UINT uiButtonIndex)
bool IsButtonUp (UINT uiButtonIndex)
UINT GetKeyState (UINT uiKeyIndex)
tVERTEX2dGetCursorPos ()
tVERTEX2dGetPrevCursorPos ()
void SetCursorPos (int x, int y)
virtual bool IsOfType (eEntityType eType)

Protected Member Functions

virtual int Create ()
virtual void Destroy ()
virtual UINT Poll ()

Protected Attributes

tVERTEX2d m_CursorPos
tVERTEX2d m_PrevCursorPos
tVERTEX2d m_CursorSpeed

Detailed Description

Mouse Device class.

This class provides an easy and clear shell for ANY mouse device

Definition at line 12 of file Mouse.h.


Member Function Documentation

int CMouse::Create  )  [protected, virtual]
 

Method details:

Returns:
1 if device has been created succesfully, 0 otherwise

Implements CInputDevice.

Definition at line 15 of file Mouse.cpp.

Referenced by CInputEngine::Create().

void CMouse::Destroy  )  [protected, virtual]
 

Method details: Destroys the device

Implements CInputDevice.

Definition at line 98 of file Mouse.cpp.

tVERTEX2d & CMouse::GetCursorPos  ) 
 

Method details:

Returns:
Const. Reference to 2D coordinates of the mouse cursor
Definition at line 75 of file Mouse.cpp.

References m_CursorPos.

Referenced by CGUIMenuEntry::Draw(), CGUIElement::OnMouseMove(), CGUIMenuEntry::PointInChildRects(), CGUIScrollBar::ProcessMessage(), and CGUI::Update().

UINT CMouse::GetKeyState UINT  uiKeyIndex  )  [virtual]
 

Method details:

Parameters:
uiKeyIndex - Index of the key to query
Returns:
Key state (KEY_UP or KEY_DOWN)

Reimplemented from CInputDeviceState.

Definition at line 62 of file Mouse.cpp.

Referenced by IsButtonDown(), and IsButtonUp().

tVERTEX2d & CMouse::GetPrevCursorPos  ) 
 

Method details:

Returns:
Const. Reference to previous 2D coordinates of the mouse cursor
Definition at line 80 of file Mouse.cpp.

References m_PrevCursorPos.

Referenced by CGUIElement::OnMouseMove(), CGUIScrollBar::ProcessMessage(), and CGUI::Update().

bool CMouse::IsButtonDown UINT  uiButtonIndex  ) 
 

Method details:

Parameters:
uiButtonIndex - Index of the button to query
Returns:
True if button is down, false otherwise
Definition at line 85 of file Mouse.cpp.

References GetKeyState().

Referenced by CGUIButton::GetCurrentAnimation(), and CGUI::Update().

bool CMouse::IsButtonUp UINT  uiButtonIndex  ) 
 

Method details:

Parameters:
uiButtonIndex - Index of the button to query
Returns:
True if button has just been released, false otherwise
Definition at line 90 of file Mouse.cpp.

References GetKeyState().

Referenced by CGUI::Update().

bool CMouse::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CInputDevice.

Definition at line 103 of file Mouse.cpp.

References CEntity::IsOfType().

UINT CMouse::Poll  )  [protected, virtual]
 

Method details:

Returns:
Varied return values

Implements CInputDeviceState.

Definition at line 32 of file Mouse.cpp.

References m_CursorPos, m_PrevCursorPos, tVERTEX2d::x, and tVERTEX2d::y.

Referenced by CInputEngine::Poll().

void CMouse::SetCursorPos int  x,
int  y
 

Method details: @param x,y - New (updated) coordinates for the mouseDefinition at line 70 of file Mouse.cpp.

References m_CursorPos, tVERTEX2d::x, and tVERTEX2d::y.


Member Data Documentation

tVERTEX2d CMouse::m_CursorPos [protected]
 

Mouse cursor position Definition at line 77 of file Mouse.h.

Referenced by GetCursorPos(), Poll(), and SetCursorPos().

tVERTEX2d CMouse::m_CursorSpeed [protected]
 

Mouse cursor speed (dx & dy) Definition at line 80 of file Mouse.h.

tVERTEX2d CMouse::m_PrevCursorPos [protected]
 

Previous mouse cursor position Definition at line 78 of file Mouse.h.

Referenced by GetPrevCursorPos(), and Poll().


The documentation for this class was generated from the following files:
Generated on Sun Jul 17 21:34:30 2005 for OpenGL GUI by doxygen 1.3.8