Skip to main content
GameDev.net gamedev.net
🔒 Locked

Event manager

Started by m3rcyful ag3nt Feb 20, 2007 at 8:13 AM 2 replies 1.8k views
Original Post
m3rcyful ag3nt
m3rcyful ag3nt
Hi Does anyone know a good resource where I can investigate about event managers in games? As my project is getting bigger, I need to have a common interface for all the subsystems. Thanks
Skizz
Skizz
What you're looking for is a 'Design Pattern' that meets your criteria. Wikipedia is a good starting point. There are plenty of patterns that could be used to implement an event/messaging system. You need to decide exactly what you want from the system first.

Here are three possible solutions:
1) SystemA calls SystemB::AddMessage to pass a message to SystemB, SystemB adds the message to a pending queue. SystemB implements a function to process the queue.

2) SystemB registers a handler with an EventManager. SystemA calls EventManager::SendMessage. EventManager than calls all registered handlers.

3) SystemB registers a handler for each message it is interested in receiving with an EventManager. SystemA calls EventManager::SendMessage. EventManager calls all registered handlers for the given message.

Skizz
jollyjeffers
jollyjeffers
I don't quite see how this falls under 'DirectX' so I'm moving this over to 'Game Programming'.

Cheers,
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.