title: Flash-like event binding in SDL 2
body: <p>I've been working for a while with SDL and the PollEvent method and it always served me well. However, after playing a little but with Flash-based engines, i'm trying to create an event listener system similar to the one we have in Flash. I'm thinking of something like this: (pseudo-code) </p>
  
  <pre><code>GameObject object
  object.addEventListener(MOUSE_CLICK, myClickCallback)
  </code></pre>
  
  <p>However, i'm not sure on how to make this work in an effective way. I could run PollEvent on every frame and then iterate through the entire list of GameObjects on my scene: if the event received on PollEvent is an X, call all listeners of X. However, this seems really slow. Is there a better approach? Has anyone done something similar?</p>