One that I've found useful over the years is
Pixel Toaster. It's a tiny and highly specialised library for easy cross platform framebuffer access.
It lets you work directly with 32 bit integer or 96 bit floating point pixels, regardless of what your hardware can really handle. All it does is handle opening, closing and updating a framebuffer (full screen or windowed) on linux, freebsd, mac and windows, plus receive mouse and keyboard input.
Example program:
Code: Select all
const int width = 320;
const int height = 240;
Display display( "Example", width, height );
vector<Pixel> pixels( width, height );
while ( display.open() )
{
const int x = rand() % width;
const int y = rand() % height;
pixels[x+y*width].b = 1.0f;
display.update( pixels );
}
That opens a 320x240 floating point window and makes random pixels blue until you close it.
A handy and pretty unique library is Microsoft Research's
Detours. It's purpose is to bypass functions in a dll with replacement functions in another dll. The less nice use is things like game cheats (you can intercept any opengl function call and do your own code instead, like force transparency or full lighting), but it has legitimate uses too. Currently I'm using it to make a network problem simulator. It replaces the upd socket functions in winsock with new ones which create fake packet loss, corruption, duplicates, low bandwidth, high pings, etc. So I can test network code on a lan as if it's really running on a really crappy network.
No changes to the main code are needed, all the detour code is built into a seperate dll and can be injected either when a program starts, or even into an already running process.
There's a lot of cool debugging stuff you can do with it. It can even bypass system dlls, so you could replace the MessageBox function in any executable with logging to a file instead, or do something fun with the Sleep function.