M
Michael
OK Guys, lets say that I've got some code that I want from time when I'm
debuging but want to be able to turn off quickly.
At the moment I'm doing:
#define DEBUG_TEXTURE
#define DEBUG_BSP
#define DEBUG_COLLISION
//Do Stuff:
#ifdef DEBUG_TEXTURE
//Debuging code;
//OutPuting to file/console
#endif
//More Stuff
#ifdef DEBUG_BSP
//Debuging code;
#endif
however my debug lines are normally only 1 line, so I end up with really
messy code.
What I'd like to do is:
#define DEB_BSP //
//then in code
DEB_BSP cout <<" Debug Info";
but the double forward slash wouldn't work with the #define.
What do others do to get around this? Is my original method the only way?
I could do
#define DEB_BSP 1 //make 0 to disable
if( DEB_BSP) cout << "Debug output";
but this isn't really great because I'll incur quite a performance hit at
runtime with lots of if statements!
Thanks in advance
Mike
debuging but want to be able to turn off quickly.
At the moment I'm doing:
#define DEBUG_TEXTURE
#define DEBUG_BSP
#define DEBUG_COLLISION
//Do Stuff:
#ifdef DEBUG_TEXTURE
//Debuging code;
//OutPuting to file/console
#endif
//More Stuff
#ifdef DEBUG_BSP
//Debuging code;
#endif
however my debug lines are normally only 1 line, so I end up with really
messy code.
What I'd like to do is:
#define DEB_BSP //
//then in code
DEB_BSP cout <<" Debug Info";
but the double forward slash wouldn't work with the #define.
What do others do to get around this? Is my original method the only way?
I could do
#define DEB_BSP 1 //make 0 to disable
if( DEB_BSP) cout << "Debug output";
but this isn't really great because I'll incur quite a performance hit at
runtime with lots of if statements!
Thanks in advance
Mike