Show
Ignore:
Timestamp:
09/03/10 00:25:58 (21 months ago)
Author:
Carsten
Message:

Revision of Console code:

  • New "composite console" is the new default console, making it easy to add logging into a file and the graphical console during init, and making it unnecessary to reset the console pointer in DLLs that have been initialized before the graphical console.
  • Replaced several old/obsolete printf-statements (in the renderer DLLs) with their proper Console->Print() counterparts.
  • Put the Lua bindings to the global Console into separate files. This way the DLLs can include Console.hpp without being forced to link the Lua libraries in.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Libs/MaterialSystem/RendererCgNV2X/Shaders/_CommonCgHelpers.cpp

    r36 r149  
    2727 
    2828#include "_CommonCgHelpers.hpp" 
     29#include "ConsoleCommands/Console.hpp" 
     30 
    2931#include <stdio.h> 
    3032 
     
    4143        CGerror err      =cgGetError(); 
    4244 
    43         printf("ERROR: Unable to create Cg program: %s\n", cgGetErrorString(err)); 
     45        Console->Print(std::string("ERROR: Unable to create Cg program: ")+cgGetErrorString(err)+"\n"); 
    4446        if (ErrorFile) fprintf(ErrorFile, "ERROR: Unable to create Cg program: %s\n", cgGetErrorString(err)); 
    4547 
    4648        const char* LastListing=cgGetLastListing(CgContext); 
    47         if (LastListing) printf("LAST LISTING:\n%s\n", LastListing); 
     49        if (LastListing) Console->Print(std::string("LAST LISTING:\n")+LastListing+"\n"); 
    4850        if (LastListing && ErrorFile) fprintf(ErrorFile, "LAST LISTING:\n%s\n", LastListing); 
    4951 
     
    5860    { 
    5961        // This should never happen, as we have already made sure elsewhere that the desired profile is supported! 
    60         printf("ERROR: Unable to load Cg program: %s\n", cgGetErrorString(err)); 
     62        Console->Print(std::string("ERROR: Unable to load Cg program: ")+cgGetErrorString(err)+"\n"); 
    6163        return NULL; 
    6264    }