Trouble with an Expression
Hello,
I'm Reading the Book "Advanced 3d Programming with DirectX 9.0" by Peter Walsh
Im having trouble with a Error Class explained in the Book.
class cGameError
{
private:
string m_errorText;
public:
cGameError(char* errorText)
{
DP1("***\n***[ERROR]cGameError thrown! text:[%s]\n***\n",errorText);
m_errorText = std::string(errorText);
}
const char* getText()
{
return m_errorText.c_str();
}
};
Where does that DP1 function come from ? And what's that DP1("***\n***[ERROR]cGameError thrown! text:[%s]\n***\n",errorText) ?
I don't know where it is defined but it probably means: display text at debug level one.
And it probably looks something like:
And it probably looks something like:
#include <stdio.h>#include <stdarg.h>void DP1(const char *format, ...){#if DEBUG_LEVEL >= 1 va_list args; va_start(args, format); vfprintf(stderr, format, args); va_end(args);#endif}
Thx for your Help.
By the Way, its a Windows Application. Could I use a Message Box ?
cGameError(char* errorText)
{
MessageBox(hWnd,errorText,"Error",MB_OK);
}
instead of :
cGameError(char* errorText)
{
DP1("***\n***[ERROR]cGameError thrown! text:[%s]\n***\n",errorText);
m_errorText = std::string(errorText);
}
By the Way, its a Windows Application. Could I use a Message Box ?
cGameError(char* errorText)
{
MessageBox(hWnd,errorText,"Error",MB_OK);
}
instead of :
cGameError(char* errorText)
{
DP1("***\n***[ERROR]cGameError thrown! text:[%s]\n***\n",errorText);
m_errorText = std::string(errorText);
}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement