Wednesday, December 23, 2009

C++ Code snippets

I said earlier that I would post some C++, so here we go.

Feel free to use my code in any way you see fit. I'd be curious to know if my code gets put to use, so leave a comment on here or something.

The following code is designed to run in a Win32 environment.

DataLogger.h / DataLogger.cpp - http://pastebin.com/f3a5eae52
Log to file - singleton class interface, various modes/levels of logging.

GameTimer.h / GameTimer.cpp - http://pastebin.com/fd99d76d
Timer - class interface

FontPrint.h / FontPrint.cpp - http://pastebin.com/f562ab8
On-screen debug output - drawing implemented using abstract drawing interface. Here's the 2-bit 8x8 font I use - http://farm3.static.flickr.com/2583/4209666632_c5da74397b_o.gif

And that's all I've got for now, the rest is still pretty well in active development.

No comments:

Post a Comment