Show
Ignore:
Timestamp:
08/11/10 19:17:21 (22 months ago)
Author:
Carsten
Message:

Our libraries *declare* (module-)global pointers to implementations of their interfaces,
i.e. pointers that are available for convenient access from the entire exe or dll.

Some libraries also (erroneously) provided *definitions* for these pointer instances,
namely the ConsoleInterpreter, the MaterialManager and the SoundShaderManager.

These definitions have been removed (and moved into the application code instead).

This change makes all our libraries consistent, and linking them to an application or dll easier.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/branches/cafu_to_wx/Libs/SoundSystem/SoundShaderManager.hpp

    r36 r113  
    7070}; 
    7171 
    72 /// A global pointer to the sound shader manager. 
    73 /// This pointer should be used by all code that potentially is included in a DLL and should share the common sound shader manager 
    74 /// of another module (e.g. the main executable). As the DLL will during its initialization reset this pointer to the one provided by the 
    75 /// executable, this goal is thus automatically achieved. 
     72 
     73/// A global pointer to an implementation of the SoundShaderManagerI interface. 
     74/// 
     75/// Each module (exe or dll) that uses this pointer must somewhere provide exactly one definition for it (none is provided by the SoundSys). 
     76/// That is, typically the main.cpp or similar file of each exe and dll must contain a line like 
     77///     SoundShaderManagerI* SoundShaderManager=NULL; 
     78/// or else the module will not link successfully due to an undefined symbol. 
     79/// 
     80/// Exe files will then want to reset this pointer to an instance of a SoundShaderManagerImplT during their initialization 
     81/// e.g. by code like:   SoundShaderManager=new SoundShaderManagerImplT; 
     82/// Note that the SoundShaderManagerImplT ctor may require that other interfaces (e.g. the Console) have been inited first. 
     83/// 
     84/// Dlls typically get one of their init functions called immediately after they have been loaded. 
     85/// By doing so, the exe passes a pointer to its above instance to the dll, which in turn copies it to its SoundShaderManager variable. 
    7686extern SoundShaderManagerI* SoundShaderManager; 
    7787