Simple Game Graphics Library  1.0
Data Fields
graphics::MouseState Struct Reference

#include <graphics.h>

Data Fields

bool button_left_pressed
 The left button went from an "depressed" state to a "pressed" one during the last poll cycle.
 
bool button_middle_pressed
 The middle button went from an "depressed" state to a "pressed" one during the last poll cycle.
 
bool button_right_pressed
 The right went from an "depressed" state to a "pressed" one during the last poll cycle.
 
bool button_left_released
 The left button went from an "pressed" state to a "released" one during the last poll cycle.
 
bool button_middle_released
 The middle button went from an "pressed" state to a "released" one during the last poll cycle.
 
bool button_right_released
 The right button went from an "pressed" state to a "released" one during the last poll cycle.
 
bool button_left_down
 The left button is currently held down.
 
bool button_middle_down
 The middle button is currently held down.
 
bool button_right_down
 The right button is currently held down.
 
bool dragging
 The left button is currently held down and the cursor is moving.
 
int cur_pos_x
 The current x position in pixel units of the pointing device.
 
int cur_pos_y
 The current y position in pixel units of the pointing device.
 
int prev_pos_x
 The x position in pixel units of the pointing device in the previous update cycle.
 
int prev_pos_y
 The y position in pixel units of the pointing device in the previous update cycle.
 

Detailed Description

Includes the state of the pointing device as polled by the message processing loop of the library.

This state can be polled using the getMouseState function. Typically, the mouse (and keyboard) events are polled from within the update callback:

{
// call custom code here to respond to the left mouse button press.
}

The documentation for this struct was generated from the following file:
graphics::MouseState::button_left_pressed
bool button_left_pressed
The left button went from an "depressed" state to a "pressed" one during the last poll cycle.
Definition: graphics.h:109
graphics::MouseState
Definition: graphics.h:108
graphics::getMouseState
void getMouseState(MouseState &ms)