Danbias/Code/Misc/Input/Include/Win32/Win32Mouse.h

47 lines
1.3 KiB
C
Raw Normal View History

2014-02-14 15:50:00 +01:00
/////////////////////////////////////////////////////////////////////
// Created by [Dennis Andersen] [2013]
/////////////////////////////////////////////////////////////////////
#ifndef INPUT_WIN32MOUSE_H
#define INPUT_WIN32MOUSE_H
#include "..\Mouse.h"
#include <Windows.h>
namespace Input
{
class Win32Mouse :public Mouse
{
public:
2014-02-24 16:01:06 +01:00
Win32Mouse(HWND target);
2014-02-14 15:50:00 +01:00
~Win32Mouse();
2014-02-24 16:01:06 +01:00
bool IsBtnUp(Enum::SAMI key) const override;
bool IsBtnDown(Enum::SAMI key) const override;
int GetWheelDelta() const override;
Struct::SAIPointInt2D& GetPixelPosition(Struct::SAIPointInt2D &targetMem = Struct::SAIPointInt2D()) const override;
Struct::SAIPointFloat2D& GetNormalizedPosition(Struct::SAIPointFloat2D &targetMem = Struct::SAIPointFloat2D()) override;
Struct::SAIPointFloat2D& GetDeltaPosition(Struct::SAIPointFloat2D& targetMem = Struct::SAIPointFloat2D()) const override;
void Activate () override;
void Deactivate () override;
inline bool IsActive() override { return this->isActive; }
2014-02-14 15:50:00 +01:00
void ProccessMouseData (RAWMOUSE mouse);
2014-02-24 16:01:06 +01:00
bool Create( );
2014-02-14 15:50:00 +01:00
private:
struct Buttons
{
unsigned int makeCode;
bool isDown;
};
2014-02-24 16:01:06 +01:00
static const int MAXBUTTONS =Enum::SAMI_Unknown;
Buttons buttons[MAXBUTTONS];
RAWINPUTDEVICE device;
Struct::SAIPointInt2D windowSize;
bool isActive;
2014-02-14 15:50:00 +01:00
};
}
#endif // !INPUT_WIN32MOUSE_H