Difference between revisions of "GeEventManager"

From GriffinEngine
Jump to: navigation, search
 
m (1 revision imported)
 
(No difference)

Latest revision as of 06:38, 19 November 2017

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.

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


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 );