output for debugging

Started by
2 comments, last by michael879 18 years, 4 months ago
ok in C++, using directX, how do you output easily for use in debugging? The only way I know how to output anything is rly complex and currently is what Im having a bug with. iostream doesnt work for me for some reason, but Im guessing its because of directX, cause it works in other programs I make. I just need something simple like cout << "blah";
Advertisement
You could create a console window if you want real time data and output to that. Or create a logging class. For the console stuff see:

http://benryves.com/tutorials/?t=winconsole&c=all
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp

I have both, works well. I log for major errors and use console for monitoring data to see why stuff doesn't work correctly.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Try the DXTrace function as well as the DXTRACE_ERR, DXTRACE_ERR_MSGBOX, and DXTRACE_MSG macros. They're all documented in the SDK docs.

If you want a non-DX way of doing things, use OutputDebugString to dump stuff to the debug spew.

neneboricua
thanks

This topic is closed to new replies.

Advertisement