Jump to content
  • Advertisement
Sign in to follow this  
azherdev

Windows event driven Engine? Good or bad?

This topic is 4522 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok, I am moving this topic into it's own thread. I always wondered if using events (in my case, .net events) is ok or is too slow for a game engine. I am making a small game engine for my own use in C# and have so far stayed away from creating events inside my objects out of fear that the internal bindings would be too slow. Anyone care to weight in on this? Currently, for my GUI system, I have a function GetUIEvents() that returns a structure of what object and what event was registered. But should I just create an event within the GUI object that is fired and cought by the game? Any 2 cents on it?

Share this post


Link to post
Share on other sites
Advertisement
C# events are not windows events, thus your topic is slightly confusing.

Anyways, C# events/delegates are 'fast enough' and provide a wonderful mechanism for hooking disparate parts together and changing "reaction" state without meddling with class internals.

Share this post


Link to post
Share on other sites
Sorry, I am not aware of the proper terminology for this. But yes, you understood the question.

I am coming from business application design and there I use events extensively so my objects can communicate outside, but not sure if its efficient enough for a game.

Share this post


Link to post
Share on other sites
Yes, they are, unless you're calling a delegate for every object every frame perhaps. If the event handler does any non-trivial processing, the time taken to make the call will be a lot less than the time taken actually doing 'real stuff'.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!