User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
anneventmanager [2016/01/24 04:00]
ybalrid
anneventmanager [2017/01/29 22:55] (current)
ybalrid
Line 4: Line 4:
 ===== Event system presentation ===== ===== Event system presentation =====
  
-AnnEngine will instantiate an AnnEventManager object. AnnEventManager receive user's inputs, spatial triggers and timers timeouts and send them as convinient ​"AnnEvent" ​object to EventListeners+AnnEngine will instantiate an AnnEventManager object. AnnEventManager receive user's inputs, spatial triggers and timers timeouts and send them as convinient ​[[AnnEvent]] object to EventListeners
  
 <WRAP center round todo 60%> <WRAP center round todo 60%>
Line 30: Line 30:
  
 </​code>​ </​code>​
 +
 +You can override any of the [[AnnEventListener]] methods you want. They will be called when the said type of event is going through. ​
 +
 +
 +<WRAP center round todo 60%>
 +Explain [[AnnUserSpaceEvent]] particularities
 +</​WRAP>​
 +
 +==== Registering Event Listeners ====
 +
 +AnnEventManager keeps a list of weak_ptr to all [[AnnEventListener]] "​registered"​ via AnnEventManager::​addListener();​
 +
 +This means that you keep ownership of your listener object. You should "​unregistered"​ the listener before letting it go out of scope, this will prevent AnnEventManager to pointlessly try to lock the dangling weak pointer.