Original Post
Hi, i have a really tough problem in my Game Design: My Engine is based upon a server like master class called CComServer. Ths is the Main module which loads at startup. All other modules are in separate DLL files, one for each interface i need, so there are: Renderer (2 different of these), Sound (2 different), logic (this is the complete game logic which controls the actors, or when there is a video to play), WorldManager (this module uses another style of dlls which locate loaders for different world formats like quake3, doom3 and so on.) and input (based upon direct input) there are more but these are most important ones. Each of these Modules is derived from a class called CComClient. Each "Client" registers itself at the ComServer at startup and logs itself out of it when the dll ist unloaded (At Game End mostly). There is no given startup sequence for this modules. They load all at the same time with multiple threads for doing so. Now my Problem is the following: Some modules depend on others, for example the input interface can do nothing without a window from which to get the input an this is handled by the renderer interface. I used to have a method in my ComServer from which i could get the Interface Pointer to a module. But now i want these modules to be able to dynamically load or unload during runtime (to switch renderer from direct3d to opengl for example) this would require that all modules which depend on this switched module would get some sort of notify that their dependent module is no longer available and later upon the completition of loading the replacment module get another notification that now there is a new module which needs all setup work needed to be done again by the using module. I have now implemented a class which is some sort of smart pointer to the interfaces. This class is able to maintain the pointer to the interface. It gets set to Null when a module is unloaded and it gets the new pointer when the new module is loaded again. So far so good. But now i want this "Notification" thing so that the module which holds such a "smart pointer" is able to know when it can go to sleep and when it needs to setup its required modules again. Do you have any good suggestions on how i can accomplish this so that it is well integrated in the given environment? Thanks for reading this long post and more thanks for giving me a good advice *g*