Advertisement Jump to content
Sign in to follow this  
hoagie

Trouble with an Expression

This topic is 4992 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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) ?

Share this post


Link to post
Share on other sites
Advertisement
I don't know where it is defined but it probably means: display text at debug level one.

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
}

Share this post


Link to post
Share on other sites
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);
}


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!