I’m having trouble drawing a fairly large bitmap using glDrawPixels. The bitmap is loaded into a GLubyte array in memory and then drawn every frame. On my desktop it runs perfectly, but when I compile and run on my laptop, it takes at least 10 seconds to load everything (mouse goes hourglass hovering over the openGL window…) and then runs veerrryy slow (perhaps 1-2fps). My laptop is brand new, dual core intel, 2gb ram… the only thing I can think of is that my desktop has a Radeon HD4870 with 512mb of memory, whereas the laptop has an integrated Intel GMA 4500MHD, which I assume relies on main memory for textures etc? Could this be the problem? How can I speed things up? Or if anyone can think of another reason it’s being slowed down?
I’ve isolated the problem to the glDrawPixels call, which when commented out solves the problem.
My program is far too huge and messy to post, but here are some important lines:
//so the bitmap is about 3.6MB
GLubyte background ;
//this is done once
inFile.open(“Textures 1.2/full_level_1.bmp”, ios::in | ios::binary);
//this is done every frame
glRasterPos2f(-GRIDW/2 + screenPos, -GRIDH/2);
glBitmap (0, 0, 0, 0, -screenPos*248, 0.0f, NULL);
glDrawPixels(2818, 434, GL_BGR_EXT, GL_UNSIGNED_BYTE, &background);