geEventManager
From GriffinEngine
Manage input and collision events in the form of a queue. Implemented as Meyers Singleton. EventManager allows listeners (aka callbacks) to be set for each type of events. See definiton of geCallback on geObject page.
Contents
[hide]Usage
Getting an instance of the manager
geEventManager& em = geEventManager::instance();
Adding a listener
int tl = em.addTickListener( callbackTest );
Removing a listener
em.removeListener(tl);
Inheritance
Base classes
- geObject
- geEventManager
Reference
Methods
static geEventManager& instance();
void printListeners();
- ↖
virtual int getID(){ return 0x0400; }
For Event Consumers
int addMouseMotionListener( geCallback c, bool priority = false );
int addMouseClickListener( geCallback c, bool priority = false );
int addMouseDragListener( geCallback c, bool priority = false );
int addKeyListener( geCallback c, bool priority = false );
int addCollisionListener( geCallback c, bool priority = false );
bool removeListener( int id );
For Event Producers
void queueEvent( geMouseMotionEvent* e );
void queueEvent( geMouseClickEvent* e );
void queueEvent( geMouseDragEvent* e );
void queueEvent( geKeyEvent* e );
void queueEvent( geCollisionEvent* e );
Events |
---|
geEventManager · geKeyboard · geMouse · geTimer |
geCollisionEvent · GeKeyEvent · GeMouseClickEvent · GeMouseDragEvent · GeMouseMotionEvent |