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/Console.hpp

    r36 r113  
    6868 
    6969 
    70 /// Each module (the exe and each dll) needs a pointer to the application-wide global ConsoleI implementation. 
    71 /// For the exe, which hosts the implementation of the ConsoleI, the pointer is defined and set by linking in e.g. the ConsoleStdout.cpp file. 
    72 /// Each dll that uses the console has to provide a definition by itself, and initialize it to point to the exe's console instance. 
     70/// A global pointer to an implementation of the ConsoleI interface. 
     71/// 
     72/// Each module (exe or dll) that uses this pointer must somewhere provide exactly one definition for it (none is provided by the Console library). 
     73/// That is, typically the main.cpp or similar file of each exe and dll must contain a line like 
     74///     cf::ConsoleI* Console=NULL; 
     75/// or else the module will not link successfully due to an undefined symbol. 
     76/// 
     77/// Exe files will then want to reset this pointer to an instance of e.g. a ConsoleStdoutT during their initialization 
     78/// e.g. by code like:   Console=new cf::ConsoleStdoutT; 
     79/// 
     80/// Dlls typically get one of their init functions called immediately after they have been loaded. 
     81/// By doing so, the exe passes a pointer to its above instance to the dll, which in turn copies it to its Console variable. 
    7382extern cf::ConsoleI* Console; 
    7483