InputService stub
This commit is contained in:
@@ -1,18 +1,46 @@
|
||||
//Should potentially make a "Service" class
|
||||
#pragma once
|
||||
#include "Instance.h"
|
||||
#include "PartInstance.h"
|
||||
|
||||
namespace B3D{
|
||||
|
||||
struct MousePoint{
|
||||
Vector3 position;
|
||||
B3D::PartInstance * target;
|
||||
MousePoint(Vector3 pos, PartInstance * targ)
|
||||
{
|
||||
position = pos;
|
||||
target = targ;
|
||||
}
|
||||
};
|
||||
|
||||
class InputService : public Instance{
|
||||
public:
|
||||
InputService(void);
|
||||
InputService~(void);
|
||||
bool pollKeyState(char keyChar);
|
||||
~InputService(void);
|
||||
|
||||
//Polling
|
||||
int pollKeyState(unsigned char keyCode);
|
||||
int pollMouseX();
|
||||
int pollMouseY();
|
||||
bool pollMouseButton(int button);
|
||||
int pollMouseButton(unsigned char button);
|
||||
bool pollFocus();
|
||||
|
||||
|
||||
//Update Input
|
||||
void updateMouse(int x, int y);
|
||||
void updateFocus(bool focus);
|
||||
|
||||
//Signal
|
||||
void signalKeyState(unsigned char keyCode, bool isDown);
|
||||
void signalMouseButtonState(unsigned char button, bool isDown);
|
||||
void signalMouseWheelState(int step);
|
||||
|
||||
|
||||
private:
|
||||
int mouseX, mouseY;
|
||||
|
||||
}
|
||||
Ray lastRay;
|
||||
bool hasFocus;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user