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/ConsoleCommands/ConsoleInterpreter.hpp

    r36 r113  
    105105 
    106106 
    107 /// Each module (the exe and each dll) needs a pointer to the application-wide global ConsoleInterpreterI implementation. 
    108 /// For the exe, which hosts the implementation of the ConsoleInterpreter, the pointer is defined and set by linking in the ConsoleInterpreterImpl.cpp file. 
    109 /// Each dll that uses convars has to provide a definition by itself, and initialize it to point to the exe's ConsoleInterpreter instance. 
     107/// A global pointer to an implementation of the ConsoleInterpreterI interface. 
     108/// 
     109/// Each module (exe or dll) that uses this pointer must somewhere provide exactly one definition for it (none is provided by the ConsoleInterpreter library). 
     110/// That is, typically the main.cpp or similar file of each exe and dll must contain a line like 
     111///     ConsoleInterpreterI* ConsoleInterpreter=NULL; 
     112/// or else the module will not link successfully due to an undefined symbol. 
     113/// 
     114/// Exe files will then want to reset this pointer to an instance of a ConsoleInterpreterImplT during their initialization 
     115/// e.g. by code like:   ConsoleInterpreter=new ConsoleInterpreterImplT; 
     116/// Note that the ConsoleInterpreterImplT ctor may require that other interfaces (e.g. the Console) have been inited first. 
     117/// 
     118/// Dlls typically get one of their init functions called immediately after they have been loaded. 
     119/// By doing so, the exe passes a pointer to its above instance to the dll, which in turn copies it to its ConsoleInterpreter variable. 
    110120extern ConsoleInterpreterI* ConsoleInterpreter; 
    111121