SDLMouse Class Reference

The SDL implementation of the IMouse interface. More...

#include <Input/SDLMouse.h>

Inherits IMouse.

List of all members.

Public Member Functions

 SDLMouse ()
 Constructor.
virtual ~SDLMouse ()
 Deconstructor.
virtual bool ButtonPressed (MouseButton button, Point2i *pos=NULL) const
 Determines if the given mouse button was just pressed.
virtual bool ButtonReleased (MouseButton button, Point2i *pos=NULL) const
 Determines if the given mouse button was just released.
virtual bool ButtonDown (MouseButton button) const
 Determines if the given mouse button is down.
virtual bool WheelUp () const
 Determines if the mouse wheel has been moved up.
virtual bool WheelDown () const
 Determines if the mouse wheel has been moved down.
virtual void GainedFocus ()
 Informs the mouse that it has has gained screen focus.
virtual void LostFocus ()
 Informs the mouse that it has has lost screen focus.
virtual bool HasFocus () const
 Determines if the mouse has screen focus.
virtual void Update ()
 updates the state of the mouse. Should be called once at the beginning or the end of each frame.
virtual void MoveTo (const Point2i &pos)
 Moves the mouse to the given position.
virtual void StartFixedPositionMode ()
 Places the mouse into fixed position mode where the mouse is fixed at the origin and only relative mouse movement is considered.
virtual void EndFixedPositionMode ()
 Takes the mouse out of fixed position mode.
virtual bool InFixedPositionMode () const
 Determines if the mouse is in fixed position mode.
virtual Point2i GetPos () const
 Gets the current position of the mouse.
virtual Point2f GetPosNorm () const
 Gets the mouse position in normalized screen coordinates.
virtual Point2i GetMoveDelta () const
 Gets the amount the mouse has moved since the last update.
virtual void SetCursor (const char *file)
 Set the cursor image.
virtual SpriteGetCursor ()
 Gets the cursor image.
virtual void Draw ()
 Draws the mouse cursor.
void HandleEvent (const SDL_MouseButtonEvent &e)
 Called each time an SDL mouse event occures.

Detailed Description

The SDL implementation of the IMouse interface.


Member Function Documentation

bool SDLMouse::ButtonDown ( MouseButton  button  )  const [virtual]

Determines if the given mouse button is down.

Parameters:
[in] button the MouseButton to check.
Returns:
True if the given button has been pressed and is now being held down.

Implements IMouse.

bool SDLMouse::ButtonPressed ( MouseButton  button,
Point2i pos = NULL 
) const [virtual]

Determines if the given mouse button was just pressed.

Parameters:
[in] button the MouseButton to check.
[in] pos pointer that will hold the position where the button was pressed. Defaults to NULL.
Returns:
True if the given button has been pressed. Optionally outputs the position where the button was pressed.

Implements IMouse.

bool SDLMouse::ButtonReleased ( MouseButton  button,
Point2i pos = NULL 
) const [virtual]

Determines if the given mouse button was just released.

Parameters:
[in] button the MouseButton to check.
[in] pos pointer that will hold the position where the button was released. Defaults to NULL.
Returns:
True if the given button wass just released.

Implements IMouse.

Sprite & SDLMouse::GetCursor (  )  [virtual]

Gets the cursor image.

Returns:
The sprite used to represent the cursor.
Point2i SDLMouse::GetMoveDelta (  )  const [virtual]

Gets the amount the mouse has moved since the last update.

Returns:
the amount the mouse has moved since the last update.

Implements IMouse.

Point2i SDLMouse::GetPos (  )  const [virtual]

Gets the current position of the mouse.

Returns:
the current mouse position.

Implements IMouse.

Point2f SDLMouse::GetPosNorm (  )  const [virtual]

Gets the mouse position in normalized screen coordinates.

Returns:
the current mouse position in normalized screen coordinates.

Implements IMouse.

void SDLMouse::HandleEvent ( const SDL_MouseButtonEvent &  e  ) 

Called each time an SDL mouse event occures.

Parameters:
[in] e the SDL mouse button event.
bool SDLMouse::HasFocus (  )  const [virtual]

Determines if the mouse has screen focus.

Returns:
True if the mouse has screen focus, false otherwise.

Implements IMouse.

bool SDLMouse::InFixedPositionMode (  )  const [virtual]

Determines if the mouse is in fixed position mode.

Returns:
True if the mouse is in fixed position mode, false otherwise.

Implements IMouse.

void SDLMouse::MoveTo ( const Point2i pos  )  [virtual]

Moves the mouse to the given position.

Parameters:
[in] pos the position to move the mouse to.
void SDLMouse::SetCursor ( const char *  file  )  [virtual]

Set the cursor image.

Parameters:
[in] file the name of the cursor image file.
bool SDLMouse::WheelDown (  )  const [virtual]

Determines if the mouse wheel has been moved down.

Returns:
True if the mouse wheel has been moved down.

Implements IMouse.

bool SDLMouse::WheelUp (  )  const [virtual]

Determines if the mouse wheel has been moved up.

Returns:
True if the mouse wheel has been moved up.

Implements IMouse.


The documentation for this class was generated from the following files:
Generated on Mon Apr 5 19:08:06 2010 for BrickOut |ReDuX| by  doxygen 1.6.3