b3view/EventHandler.h

48 lines
954 B
C
Raw Normal View History

2010-04-21 14:48:36 +00:00
#ifndef EVENTHANDLER_H
#define EVENTHANDLER_H
#include <iostream>
#include <map>
#include <utility>
2019-03-07 11:12:09 -05:00
#include <irrlicht/irrlicht.h>
2010-04-21 14:48:36 +00:00
#include "Debug.h"
using std::cout;
using std::endl;
using std::map;
using std::make_pair;
enum EventReceiverType
{
ERT_USERINTERFACE = 1,
ERT_3DVIEW = 2
};
enum UserEventIdentifier
{
UEI_WINDOWSIZECHANGED = 1
};
class EventHandler : public irr::IEventReceiver
2010-04-21 14:48:36 +00:00
{
private:
irr::IrrlichtDevice *m_Device;
2010-04-21 14:48:36 +00:00
map<EventReceiverType, IEventReceiver*> *m_EventReceivers;
bool KeyIsDown[irr::KEY_KEY_CODES_COUNT];
irr::s32 keyState[irr::KEY_KEY_CODES_COUNT];
irr::s32 LMouseState,RMouseState;
2010-04-21 14:48:36 +00:00
public:
EventHandler( irr::IrrlichtDevice *device );
2010-04-21 14:48:36 +00:00
~EventHandler();
bool addEventReceiver(EventReceiverType type, irr::IEventReceiver *receiver );
2010-04-21 14:48:36 +00:00
// IEventReceiver
virtual bool OnEvent( const irr::SEvent &event );
std::wstring m_PreviousPath;
2010-04-21 14:48:36 +00:00
};
#endif // EVENTHANDLER_H