Can anyone see what's wrong with this code?
SIZE_BG is 6MB as I am trying to draw a large bitmap image (3366x600). I use malloc to prevent my image from overflowing the stack. I get an access violation error on the call to glDrawPixels(). bgPtr seems to point to the correct data as I checked the first few bytes before calling glDrawPixels and they are correct.
bgPtr = (char*)malloc(SIZE_BG);
fstream inFile(texFileName, ios::in | ios::binary);
inFile.read(bgPtr, SIZE_BG);
inFile.close();
//... other code
glDrawPixels(3366, 600, GL_BGRA_EXT, GL_UNSIGNED_BYTE, bgPtr+54);