b3view/EventHandler.h

41 lines
783 B
C
Raw Normal View History

2010-04-21 07:48:36 -07:00
#ifndef EVENTHANDLER_H
#define EVENTHANDLER_H
#include <iostream>
#include <map>
#include <utility>
#include "Debug.h"
#include <irrlicht/irrlicht.h>
2010-04-21 07:48:36 -07:00
using std::cout;
using std::endl;
using std::make_pair;
using std::map;
2010-04-21 07:48:36 -07:00
enum EventReceiverType {
2010-04-21 07:48:36 -07:00
ERT_USERINTERFACE = 1,
ERT_3DVIEW = 2
};
enum UserEventIdentifier {
UEI_WINDOWSIZECHANGED = 1
};
class EventHandler : public irr::IEventReceiver {
2010-04-21 07:48:36 -07:00
private:
irr::IrrlichtDevice* m_Device;
map<EventReceiverType, IEventReceiver*>* m_EventReceivers;
2010-04-21 07:48:36 -07:00
public:
EventHandler(irr::IrrlichtDevice* device);
2010-04-21 07:48:36 -07:00
~EventHandler();
bool addEventReceiver(EventReceiverType type, irr::IEventReceiver* receiver);
2010-04-21 07:48:36 -07:00
// IEventReceiver
virtual bool OnEvent(const irr::SEvent& event);
2010-04-21 07:48:36 -07:00
};
#endif // EVENTHANDLER_H