Danbias/Code/Misc/Input/Include/Common.h

71 lines
1.7 KiB
C
Raw Normal View History

2014-02-14 15:50:00 +01:00
/////////////////////////////////////////////////////////////////////
// Created by [Dennis Andersen] [2013]
/////////////////////////////////////////////////////////////////////
#ifndef INPUT_COMMON_H
#define INPUT_COMMON_H
#include "PreReq.h"
#include <math.h>
namespace Input
{
class Keyboard;
class Mouse;
class InputManager;
class InputObject;
/*********************************************************************/
namespace Enum
{
enum SAIType
{
SAIType_Keyboard,
SAIType_Mouse,
SAIType_futureExample1,
SAIType_futureExample2,
SAIType_futureExample3,
};
enum ButtonState
{
ButtonState_Press, // When button is pressed (once)
ButtonState_Down, // When the button is held down
ButtonState_Release, // When button is released (once)
ButtonState_Up, // Default state, will not be proccesed as a callback!
ButtonState_Unknown,
2014-02-14 15:50:00 +01:00
};
}
/*********************************************************************/
namespace Struct
{
2014-02-24 16:01:06 +01:00
struct SAIPointInt2D
2014-02-14 15:50:00 +01:00
{
int x;
int y;
2014-02-24 16:01:06 +01:00
SAIPointInt2D() :x(0), y(0) { }
SAIPointInt2D(int _x, int _y) :x(_x), y(_y) { }
2014-02-14 15:50:00 +01:00
int Length() { return (abs(x) + abs(y)); }
};
2014-02-24 16:01:06 +01:00
struct SAIPointFloat2D
{
float x;
float y;
SAIPointFloat2D() :x(0.0f), y(0.0f) { }
SAIPointFloat2D(float _x, float _y) :x(_x), y(_y) { }
float Length() { return (fabs(x) + fabs(y)); }
};
2014-02-14 15:50:00 +01:00
struct InputData;
}
/*********************************************************************/
namespace Typedefs
{
typedef void(*InputCallback)(const Struct::InputData& data);
typedef void* DEVICE;
typedef void* WindowHandle;
}
/*********************************************************************/
}
#endif // !INPUT_COMMON_H