Platform/Unix/X11Mouse: adding a basic implementation to get things going.
This commit is contained in:
parent
6426679845
commit
dd8a4a0583
2 changed files with 87 additions and 1 deletions
|
|
@ -3,12 +3,16 @@
|
|||
#define PLATFORM_UNIX_X11MOUSE_H
|
||||
|
||||
#include <Spectre/Input/Mouse.h>
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
class X11Mouse : public Mouse
|
||||
{
|
||||
public :
|
||||
X11Mouse();
|
||||
~X11Mouse();
|
||||
|
||||
virtual void init();
|
||||
|
||||
// Get mouse position
|
||||
|
|
@ -18,12 +22,20 @@ public :
|
|||
|
||||
virtual bool isButtonDown(Mouse::Button button) const;
|
||||
|
||||
// Translate a XEvent to sp::Event, Called from X11EventQueue
|
||||
static bool handleMessage(XEvent* xevent, Event& event);
|
||||
|
||||
protected :
|
||||
|
||||
virtual void update(InputModule *input);
|
||||
|
||||
protected :
|
||||
::Display* m_disp;
|
||||
::Window m_win;
|
||||
|
||||
Vector2f m_position;
|
||||
|
||||
unsigned int m_btn_state;
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue