   Event based idea
  I''ve been trying to think of a game event idea, and this came to mind. My game engine will work like Win32, when the player walks upto a person to talk to him/her, it sends out GE_MSG_EVENT. When the programmer creates it, they will have to program a message process function that the engine will send the event out to. This way each programmer can respond to an event differently. My question is: is there any way to do this without using function pointers (I don''t quite understand them yet)? Thanks for any help!   /*I use DirectX 8.1 and C++ (Microsoft Visual C++ 6.0 Professional edition)*/ 
  I say it''s a quite bad idea. Often event handlers depend on each other and the order of execution is therefore crusial. ;  IMO it depends on the application.I use an event like system (function callback) for my menu-handler. If a button is pressed, it calls the functor (function pointer thingy) with the ID if the button that has been pressed.Same for my new network module, it implements the observer-pattern for making callbacks incase data is received or a client connected/disconnected.These events happen in different threads, and both systems are re-usable modules.For game events this might not be as suitable because, as Doho said, you get synchronisation issues, assuming that you use different threads (else an event system is as good as obsolete).For threaded and especially modular systems this can be the best solution because you can leave the actual implementation of the event in another class/module that is re-implemented each project.Also take into account that an event system might not be as flexible as you might wish. You can only put an x amount of data in your event call.;  After you read about function pointers and functors, you''ll see how much easier it is to work with them.Alternatively, I think you could have a message processing class with default behavior that the user could override: class BaseHandler {public:    virtual HandleQuit() {   PostQuitMessage( 0 );    }};class MyHandler {public:    virtual HandleQuit() {   // call custom shutdown code   Kernel::GetSingleton().Shutdown();   // then do default behavior   BaseHandler::HandleQuit();    }};I''m sure there''s a better way than providing a different function for each event, but it escapes me right now.. 