I'm writing a program in OpenGL, and there's going to be custom events that are going to happen, ex. when a player hits an obstacle or takes a step. What I want to do is:
Have a singleton class named something like "EventBroadcaster." The broadcaster will get fed events from around the program. Then, when it receives an event, it will send it to all the listeners ("EventListener" objects) with a void* containing a struct which holds the event's information. The EventListener objects can then use their own custom callback function to handle the different types of events. Now, I want to avoid using void* if it all possible, so...
...question is, how can I do this with a template interface?