using gldrawpixels


i need to use gldrawpixels to place 24 bit bmp images as backgrounds for an opengl screen. For various reasons i cannot use a quad textured for the background eben though i know it would be faster.

My problem is im loading a bmp as a resource file and can successfully get it on screen using gldrawpixels, but i have to loop through every pixel of the bmp file to create an appropriate array for passing to opengl.

Under win2000 using BCB6 c++ is there not a faster way to assign the bmp data to opengl without have to iterate through loops. It dosnt seem possible to jsut pass a pointer as the bmp windows format does not match gldrawpixels requirments

any help appreciated


Check out GetDIBits() and glDrawPixels format GL_BGR.

the documentation for gldrawpixels does not list a format GL_BGR.

It shows multiple others such as GL_RGB, but of course this is the wrong way round

Your documentation is probably old then. Check the API specification (direct link, 2MB PDF). glDrawPixels starts on page 102, and the table of valid formats is table 3.6 on page 105.