This is supposedly very simple to do, yet I can't get it to work. It uses OpenGL functions to actually draw the bitmap but i still think it's more appropriate in the C++ board. Anyway this doesn't work and I'm wondering if I did anything wrong

code for loading the bitmap:
Code:
byte * LoadBMP(char * filename, BITMAPINFOHEADER *bih) {
	byte * imageData;	//THIS WILL END UP BEING OUR IMAGE READ FROM THE FILE
	ifstream fin(filename, ios::in | ios::binary | ios::nocreate);	//OPEN FILE
	if(fin.fail())
             return NULL;                                       
	fin.seekg(0, ios::end);
	long filesize = fin.tellg();
	fin.seekg(0, ios::beg);
	byte * buffer = new byte[filesize];  //ALLOCATE TEMPORARY BUFFER
	fin.read(buffer, filesize);
	fin.close();
	const byte * ptr = buffer;	//CREATE POINTER TO BUFFER TO EXTRACT STUFF FROM THE FILE
	BITMAPFILEHEADER * pHeader = (BITMAPFILEHEADER*)ptr;	//EXTRACT THE BITMAPFILEHEADER TO CHECK TYPE
	ptr += sizeof(BITMAPFILEHEADER);	//GO PAST BITMAPFILEHEADER IN FILE
	if(pHeader->bfType != BITMAP_ID) {	//CHECK THE TYPE, DEFINED IN MAIN.H
		MessageBox(NULL, "BITMAP ID INVALID", "BITMAP ID INVALID", MB_OK);
		return NULL;
	}
	bih = (BITMAPINFOHEADER*) ptr;	//EXTRACT OUR BITMAPINFOHEADER
	ptr += sizeof(BITMAPINFOHEADER);

	imageData = new byte[bih->biSizeImage];
	imageData = (byte*)ptr;	//EXTRACT ALL OF THE INFORMATION FOR THE IMAGE
	//SWAP THE R AND B VALUES OF THE IMAGE DATA
	
	return imageData;	//RETURN IT
}
code used in main to actually draw the bitmap (this is opengl specific stuff):
Code:
//globals
byte * bitmap;
BITMAPINFOHEADER bih;
//...
	glRasterPos2i(100, 100);	//START DRAWING AT THESE PIXELS
	glPixelStorei(GL_UNPACK_ALIGNMENT, 4);	//SET MEMORY ALIGNMENT
	glDrawPixels(bih.biWidth, bih.biHeight, GL_RGB, GL_UNSIGNED_BYTE, bitmap); //DRAW STUFF!
this should be displaying something, albeit the fact that I should have switched the red and blue values with the current mode I'm using in drawpixels (supposedly with opengl 1.2 and later you can use GL_BGR to draw, but that enumerated type doesn't seem to exist).

thanks if anyone can help this poor soul