PDA

View Full Version : using gldrawpixels



08-08-2004, 11:47 PM
Hello,

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

thanks

Relic
08-09-2004, 12:26 AM
Check out GetDIBits() and glDrawPixels format GL_BGR.

08-09-2004, 12:39 AM
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

Bob
08-09-2004, 02:18 AM
Your documentation is probably old then. Check the API specification (http://www.opengl.org/documentation/specs/version1.5/glspec15.pdf) (direct link, 2MB PDF). glDrawPixels starts on page 102, and the table of valid formats is table 3.6 on page 105.