The SDL implementation of the IMouse interface. More...
#include <Input/SDLMouse.h>
Inherits IMouse.
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 Sprite & | GetCursor () |
| 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. | |
The SDL implementation of the IMouse interface.
| bool SDLMouse::ButtonDown | ( | MouseButton | button | ) | const [virtual] |
Determines if the given mouse button is down.
| [in] | button | the MouseButton to check. |
Implements IMouse.
| bool SDLMouse::ButtonPressed | ( | MouseButton | button, | |
| Point2i * | pos = NULL | |||
| ) | const [virtual] |
Determines if the given mouse button was just pressed.
| [in] | button | the MouseButton to check. |
| [in] | pos | pointer that will hold the position where the button was pressed. Defaults to NULL. |
Implements IMouse.
| bool SDLMouse::ButtonReleased | ( | MouseButton | button, | |
| Point2i * | pos = NULL | |||
| ) | const [virtual] |
Determines if the given mouse button was just released.
| [in] | button | the MouseButton to check. |
| [in] | pos | pointer that will hold the position where the button was released. Defaults to NULL. |
Implements IMouse.
| Sprite & SDLMouse::GetCursor | ( | ) | [virtual] |
Gets the cursor image.
| Point2i SDLMouse::GetMoveDelta | ( | ) | const [virtual] |
Gets the amount the mouse has moved since the last update.
Implements IMouse.
| Point2i SDLMouse::GetPos | ( | ) | const [virtual] |
| Point2f SDLMouse::GetPosNorm | ( | ) | const [virtual] |
Gets the mouse position in normalized screen coordinates.
Implements IMouse.
| void SDLMouse::HandleEvent | ( | const SDL_MouseButtonEvent & | e | ) |
Called each time an SDL mouse event occures.
| [in] | e | the SDL mouse button event. |
| bool SDLMouse::HasFocus | ( | ) | const [virtual] |
Determines if the mouse has screen focus.
Implements IMouse.
| bool SDLMouse::InFixedPositionMode | ( | ) | const [virtual] |
Determines if the mouse is in fixed position mode.
Implements IMouse.
| void SDLMouse::MoveTo | ( | const Point2i & | pos | ) | [virtual] |
Moves the mouse to the given position.
| [in] | pos | the position to move the mouse to. |
| void SDLMouse::SetCursor | ( | const char * | file | ) | [virtual] |
Set the cursor image.
| [in] | file | the name of the cursor image file. |
| bool SDLMouse::WheelDown | ( | ) | const [virtual] |
Determines if the mouse wheel has been moved down.
Implements IMouse.
| bool SDLMouse::WheelUp | ( | ) | const [virtual] |
Determines if the mouse wheel has been moved up.
Implements IMouse.
1.6.3