2014-02-11 09:16:01 +01:00
|
|
|
//////////////////////////////////////
|
|
|
|
// Created by Pontus Fransson 2014 //
|
|
|
|
//////////////////////////////////////
|
|
|
|
|
2014-01-31 15:38:12 +01:00
|
|
|
#ifndef MISC_IEVENT_BUTTON
|
|
|
|
#define MISC_IEVENT_BUTTON
|
2014-02-11 09:16:01 +01:00
|
|
|
|
|
|
|
class InputClass;
|
2014-01-31 15:06:25 +01:00
|
|
|
|
|
|
|
namespace Oyster
|
|
|
|
{
|
|
|
|
namespace Event
|
|
|
|
{
|
2014-02-11 09:16:01 +01:00
|
|
|
enum ButtonState
|
|
|
|
{
|
|
|
|
ButtonState_None,
|
|
|
|
ButtonState_Hover,
|
|
|
|
ButtonState_Pressed,
|
|
|
|
ButtonState_Down,
|
|
|
|
ButtonState_Released,
|
|
|
|
};
|
2014-02-12 15:44:27 +01:00
|
|
|
|
|
|
|
//Takes normalized device coordinates
|
|
|
|
struct MouseInput
|
|
|
|
{
|
|
|
|
//Normalized device coordinates
|
|
|
|
float x, y;
|
|
|
|
bool mouseButtonPressed;
|
|
|
|
};
|
2014-02-11 09:16:01 +01:00
|
|
|
|
2014-01-31 15:06:25 +01:00
|
|
|
class IEventButton
|
|
|
|
{
|
2014-01-31 15:38:12 +01:00
|
|
|
public:
|
2014-02-11 09:16:01 +01:00
|
|
|
virtual ~IEventButton(){}
|
2014-01-31 15:06:25 +01:00
|
|
|
|
2014-02-11 14:13:35 +01:00
|
|
|
virtual void Render() = 0;
|
2014-02-12 15:44:27 +01:00
|
|
|
|
|
|
|
virtual void Update(MouseInput& input) = 0;
|
2014-01-31 15:06:25 +01:00
|
|
|
|
2014-02-11 14:13:35 +01:00
|
|
|
virtual void SendEvent(ButtonState state) = 0;
|
2014-01-31 15:06:25 +01:00
|
|
|
|
2014-02-11 14:13:35 +01:00
|
|
|
virtual unsigned int GetID() = 0;
|
2014-01-31 15:06:25 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
2014-01-31 15:38:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|