Debug Class Reference

Provides a service to write debug data to a log file. Also provides realtime onscreen visualisation of debug values. More...

#include <debug.h>

List of all members.

Public Types

enum  DEBUG_TYPE { DBGT_CONSOLE = 0, DBGT_FILE, DBGT_CONSOLE_AND_FILE }

Public Member Functions

 Debug (irr::IrrlichtDevice *d, irr::c8 *fileName, irr::core::rect< irr::s32 > position)
 ~Debug ()
 Destructor.
void log (const irr::core::stringc text)
void log (const irr::core::stringw text)
void log (const irr::core::stringw text, const irr::core::stringw value)
void log (const irr::core::stringc text, const irr::c8 *description, const irr::core::stringc value)
void log (const irr::c8 *text, const irr::core::stringc description, const irr::c8 *value)
void log (const irr::c8 *text)
void log (const irr::c8 *text, const irr::c8 *value)
void log (const irr::c8 *text, const irr::c8 *description, const irr::c8 *value)
void log (const irr::c8 *text, const irr::s32 value)
void log (const irr::c8 *text, const irr::u32 value)
void log (const irr::c8 *text, const irr::u32 description, const irr::u32 value)
void log (const irr::c8 *text, const irr::f32 value)
void log (const irr::c8 *text, const irr::core::stringw value)
void log (const irr::c8 *text, const irr::core::stringc value)
void log (const irr::c8 *text, const irr::core::vector3d< irr::f32 > vector)
void show (const irr::c8 *text)
void show (const irr::c8 *text, const irr::u32 value)
void show (const irr::c8 *text, const irr::s32 value)
void show (const irr::c8 *text, const irr::f32 value, bool cutDecimals=true)
void show (const irr::c8 *text, const irr::core::vector3d< irr::f32 > vector)
void update (void)
void setOutput (DEBUG_TYPE dbgType)


Detailed Description

Provides a service to write debug data to a log file. Also provides realtime onscreen visualisation of debug values.

Multiple instances can be created. Usualy you need only one (system wide and global) Debug object. You have to call update() each cycle you want to see debug values on screen (usualy you do this inside your main-loop).

Definition at line 11 of file debug.h.


Member Enumeration Documentation

enum Debug::DEBUG_TYPE
 

Pass one of these enumeration definitions to function setOutput() to define how incoming debug data is handled.

Enumerator:
DBGT_CONSOLE  Only write incoming debug data to console.
DBGT_FILE  Only write incomming debug data to file.
DBGT_CONSOLE_AND_FILE  Write incomming debug data to both, console and file. This is set by default.

Definition at line 17 of file debug.h.


Constructor & Destructor Documentation

Debug::Debug irr::IrrlichtDevice *  d,
irr::c8 *  fileName,
irr::core::rect< irr::s32 >  position
 

Constructor

Parameters:
d : An IrrlichtDevice*, needed to access filesystem.
fileName : A string (path and filename) naming the log file. Log file will be created, if not already present. Log file will be overwritten, if already present.
position : A rectangular, defines where onscreen data will be presented.


Member Function Documentation

void Debug::log const irr::c8 *  text,
const irr::core::vector3d< irr::f32 >  vector
 

Writes debug data to console and/or file. Output will be: "text: x=vector.X y=vector.Y z=vector.Z"

Parameters:
text : A string as debug data.
vector : A vector (type float) as debug data.

void Debug::log const irr::c8 *  text,
const irr::core::stringc  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A string as debug data.
value : A string as debug data.

void Debug::log const irr::c8 *  text,
const irr::core::stringw  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A string as debug data.
value : A string as debug data.

void Debug::log const irr::c8 *  text,
const irr::f32  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A string as debug data.
value : A float as debug data.

void Debug::log const irr::c8 *  text,
const irr::u32  description,
const irr::u32  value
 

Writes debug data to console and/or file. Output will be: "text: description: value".

Parameters:
text : A string as debug data.
description : A unsigned int as debug data.
value : A unsigned int as debug data.

void Debug::log const irr::c8 *  text,
const irr::u32  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A string as debug data.
value : A unsigned int as debug data.

void Debug::log const irr::c8 *  text,
const irr::s32  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A string as debug data.
value : A signed int as debug data.

void Debug::log const irr::c8 *  text,
const irr::c8 *  description,
const irr::c8 *  value
 

Writes debug data to console and/or file. Output will be: "text: description: value".

Parameters:
text : A first string as debug data.
description : A second string as debug data.
value : A third string as debug data.

void Debug::log const irr::c8 *  text,
const irr::c8 *  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A first string as debug data.
value : A second string as debug data.

void Debug::log const irr::c8 *  text  ) 
 

Writes debug data to console and/or file.

Parameters:
text : A string as debug data.

void Debug::log const irr::c8 *  text,
const irr::core::stringc  description,
const irr::c8 *  value
 

Writes debug data to console and/or file. Output will be: "text: description: value".

Parameters:
text : A first string as debug data.
description : A second string as debug data.
value : A third string as debug data.

void Debug::log const irr::core::stringc  text,
const irr::c8 *  description,
const irr::core::stringc  value
 

Writes debug data to console and/or file. Output will be: "text: description: value".

Parameters:
text : A first string as debug data.
description : A second string as debug data.
value : A third string as debug data.

void Debug::log const irr::core::stringw  text,
const irr::core::stringw  value
 

Writes debug data to console and/or file. Output will be: "text: value".

Parameters:
text : A first string as debug data.
value : A second string as debug data.

void Debug::log const irr::core::stringw  text  ) 
 

Writes debug data to console and/or file.

Parameters:
text : A string as debug data.

void Debug::log const irr::core::stringc  text  ) 
 

Writes debug data to console and/or file.

Parameters:
text : A string as debug data.

Referenced by StateTornado::entry(), StateTerrain::entry(), StateMenu::entry(), StateFlockSimulation::entry(), StateClose::entry(), State::entry(), StateTornado::exit(), StateTerrain::exit(), StateMenu::exit(), StateFlockSimulation::exit(), StateClose::exit(), State::exit(), StateMachine::startWith(), Flock::~Flock(), FlockAnimatorDefault::~FlockAnimatorDefault(), FlockAnimatorExplode::~FlockAnimatorExplode(), FlockAnimatorTornado::~FlockAnimatorTornado(), Roller::~Roller(), Temp::~Temp(), and Terrain::~Terrain().

void Debug::setOutput DEBUG_TYPE  dbgType  ) 
 

Specify where this service should write debug data.

Parameters:
dbgType : A enumeration describing the behavior of this class.
See also:
DEBUG_TYPE

Definition at line 235 of file debug.cpp.

void Debug::show const irr::c8 *  text,
const irr::core::vector3d< irr::f32 >  vector
 

Let debug data appear onscreen in realtime. Sometimes it is hard to track debug values on console output because they change that fast. Here comes a handy function to show debug data, it will not write into a file! Calling this function will slow down your game a lot. You must call update() afterwards to visualize all debug content.

Parameters:
text : A string as debug data.
vector : A vector (type float) as debug data. vector.X and vector.Y and vector.Z is always cut to 2 decimals.
See also:
update()

void Debug::show const irr::c8 *  text,
const irr::f32  value,
bool  cutDecimals = true
 

Let debug data appear onscreen in realtime. Sometimes it is hard to track debug values on console output because they change that fast. Here comes a handy function to show debug data, it will not write into a file! Calling this function will slow down your game a lot. You must call update() afterwards to visualize all debug content.

Parameters:
text : A string as debug data.
value : A float as debug data.
cutDecimals : A boolean. True means: value is cut to 2 decimals. False means: value is not cut and thus can have a lot of decimals (hard to read).
See also:
update()

void Debug::show const irr::c8 *  text,
const irr::s32  value
 

Let debug data appear onscreen in realtime. Sometimes it is hard to track debug values on cosole output because they change that fast. Here comes a handy function to show debug data, it will not write into a file! Calling this function will slow down your game a lot. You must call update() afterwards to visualize all debug content.

Parameters:
text : A string as debug data.
value : A signed int as debug data.
See also:
update()

void Debug::show const irr::c8 *  text,
const irr::u32  value
 

Let debug data appear onscreen in realtime. Sometimes it is hard to track debug values on console output because they change that fast. Here comes a handy function to show debug data, it will not write into a file! Calling this function will slow down your game a lot. You must call update() afterwards to visualize all debug content.

Parameters:
text : A string as debug data.
value : A unsigned int as debug data.
See also:
update()

void Debug::show const irr::c8 *  text  ) 
 

Let debug data appear onscreen in realtime. Sometimes it is hard to track debug values on console output because they change that fast. Here comes a handy function to show debug data, it will not write into a file! Calling this function will slow down your game a lot. You must call update() afterwards to visualize all debug content.

Parameters:
text : A string as debug data.
See also:
update()

void Debug::update void   ) 
 

Draws all debug data you have pased to this service by show() functions on screen into a irr::gui::IGUIStaticText field. Calling this cyclic will erase all gathered debug data since last frame and draws the new ones.

Definition at line 306 of file debug.cpp.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 17:09:58 2007 for Swarm by  doxygen 1.4.6-NO