Basic GL Texture Loader

I'm using GLUT at the minute because the majority of what I'm doing is in Visual Studio and I'd like some compatibility to allow me to work at home in Project Builder. The thing is all the texturing examples I seem to come across are in Cocoa and my knowledge of C/C++/Java aren't helping me decipher it.

There's no glaux.h so I tried rewriting the standard AUX_RGBImageRec but came to a bit of a dead end.

I'm assuming I need to use NSImageRep or something but I'm having difficulty even using it.

For simple texture loading, few things beat the Targa format. There's a great tutorial on loading TGA:s over at Nehe on loading them. They support the alpha channel (which BMP doesn't), and there is no compression to worry about. (there's a RLE-encoded version, too, if you feel daring.
The only quirk is that they are loaded up-side down, but that's rarely a problem. Just invert them in your image editor, or specify your UV:s upside down.

In short, TGA loading is done like this:

Parse the header to see if it's a compressed or uncompressed TGA file (a simple memcmp)