February 5, 2010
Statistics, DXUT extensions & Boost support added

I’ve decided to make it good and it took me a whole day to create a nice interface for printing out debug information, on the screen, on demand from wherever you like. Some might say what? why? There is always “cout «” you could use! Yeah good luck trying to track the position of an object at the command line…

I had all the nice functions already in place but the usage was a mess. You had to create a char buffer everytime, then write into that buffer then you could sent the message to the engine to post it. Now you just call a nice macro (for example PrintStat(4, “Object %d position: %f %f %f”, % obj->GetID() % obj->GetX() % obj->GetY() % obj->GetZ());) with as many arguments as you like - just like C#. The change is significant and it will pay off for sure the day I’ll try to debug those networking or collision detection algorithms and I will be able to concentrate on the actual algorithm rather on how to format the data and create the char buffers to print out the debug information.

I’ve actually used DXUT’s UI functions to do the text rendering. There was no specific reason to do that and I could have actually copied my previous great working code. But now everything looks so much consistent and it always feels safer using Microsoft’s functions. The odd formatting with the % things it’s not my invention; it’s actually boost::format functionality as I’ve also integrated the boost library into my engine.

I’ve also wrote a bit of the scenegraph but that was not the main focus today. I’m still a bit worried over the camera though. I can just throw my nice old working code in but I really want to use DXUT for that instead as it offers some nice camera functionality.