#include <Mouse.h>

Public Member Functions | |
| void | registerListener (MouseListener *listener) |
| Registers a mouse listener. | |
| void | unregisterListener (MouseListener *listener) |
| Unregisters a mouse listener. | |
| void | processEvent (SDL_Event &event) |
| Enables the class to respond to SDL events. | |
| buttonState & | getButtons () |
| Getter for the button states. | |
| GLuint & | getX () |
| Getter for the x coordinate. | |
| GLuint & | getY () |
| Getter for the y coordinate. | |
| GLint & | getXRel () |
| Getter for the relative x Coordinate. | |
| GLint & | getYRel () |
| Getter for the relative y coordinate. | |
| void | setButtons (const buttonState &buttons) |
| Setter for the Button states. | |
| void | setX (const GLuint &x) |
| Setter for the x coordinate. | |
| void | setY (const GLuint &y) |
| Setter for the y coordinate. | |
| void | setXRel (const GLint &xRel) |
| Setter for the relative x coordinate. | |
| void | setYRel (const GLint &yRel) |
| Setter for the relative y coordinate. | |
| void | setSelected (const GLuint &selectId) |
| Removes selection. | |
| virtual string | toString () const |
| Returns a textual representation. | |
| virtual string | className () const |
| Returns the class name of the object. | |
| virtual enum classId | classId () const |
| Returns the class id of the object. | |
Static Public Member Functions | |
| static Mouse * | getInstance () |
| The singleton getter. | |
Private Member Functions | |
| Mouse () | |
| The constructor. | |
| Mouse (const Mouse &source) | |
| The copy constructor. | |
| ~Mouse () | |
| The destructor. | |
Private Attributes | |
| vector< MouseListener * > | listeners |
| buttonState | buttons |
| The state of the buttons. | |
| GLuint | x |
| The position of the Mouse in x direction. | |
| GLuint | y |
| The position of the Mouse in y direction. | |
| GLint | xRel |
| The relative position of the Mouse in x direction. | |
| GLint | yRel |
| The relative p osition of the Mouse in y direction. | |
| GLuint | selectId |
| The id of the last selected object. | |
Static Private Attributes | |
| static Mouse * | instance = 0 |
| The singleton instance. | |
| Mouse::Mouse | ( | ) | [private] |
The constructor.
Initializes the mouse class.
| Mouse::Mouse | ( | const Mouse & | source | ) | [private] |
The copy constructor.
Should not be called.
| Mouse::~Mouse | ( | ) | [private] |
The destructor.
Destroyes the mouse instance Should only be called for program termination.
| Mouse * Mouse::getInstance | ( | ) | [static] |
The singleton getter.
The only way to access the mouse class
| void Mouse::registerListener | ( | MouseListener * | listener | ) |
Registers a mouse listener.
Adds a new MouseListener to be informed of all mouse events. Does nothing if the listener is allready present.
| listener | The listener to be registered |
| void Mouse::unregisterListener | ( | MouseListener * | listener | ) |
Unregisters a mouse listener.
| void Mouse::processEvent | ( | SDL_Event & | event | ) | [virtual] |
| buttonState & Mouse::getButtons | ( | ) |
Getter for the button states.
| GLuint & Mouse::getX | ( | ) |
Getter for the x coordinate.
| GLuint & Mouse::getY | ( | ) |
Getter for the y coordinate.
| GLint & Mouse::getXRel | ( | ) |
Getter for the relative x Coordinate.
| GLint & Mouse::getYRel | ( | ) |
Getter for the relative y coordinate.
| void Mouse::setButtons | ( | const buttonState & | buttons | ) |
Setter for the Button states.
| void Mouse::setX | ( | const GLuint & | x | ) |
Setter for the x coordinate.
| void Mouse::setY | ( | const GLuint & | y | ) |
Setter for the y coordinate.
| void Mouse::setXRel | ( | const GLint & | xRel | ) |
Setter for the relative x coordinate.
| void Mouse::setYRel | ( | const GLint & | yRel | ) |
Setter for the relative y coordinate.
| void Mouse::setSelected | ( | const GLuint & | selectedId | ) |
Removes selection.
This function is called by the renderer each frame BEFORE rendering.
| string Mouse::toString | ( | ) | const [virtual] |
Returns a textual representation.
Implements EventListener.
| string Mouse::className | ( | ) | const [virtual] |
Returns the class name of the object.
Implements EventListener.
| enum classId Mouse::classId | ( | ) | const [virtual] |
Mouse * Mouse::instance = 0 [static, private] |
The singleton instance.
vector<MouseListener*> Mouse::listeners [private] |
buttonState Mouse::buttons [private] |
The state of the buttons.
GLint Mouse::xRel [private] |
The relative position of the Mouse in x direction.
GLint Mouse::yRel [private] |
The relative p osition of the Mouse in y direction.
GLuint Mouse::selectId [private] |
The id of the last selected object.
1.5.6