PDA

View Full Version : Loading a background bitmap image?



02-09-2004, 07:24 AM
I need to load a background bitmap image into a glut window (using visual studio 6). How can I achieve this? Also the bitmap image is not a standard size (270x390)...is that a problem? 270x390 is my current window size as I need it to fill the glut window. Cheers!

ZbuffeR
02-09-2004, 09:16 AM
You can use glDrawPixels, it is simple, but it will not give the best performance. Try it however, it may be enough, as your resolution is not too big.

You can use a texture, even if you need 'nonstandard' resolutions : use a 512x512 texture, fill only what you actually need from the lower left corner (glTexSubImage2D), bind that texture, then draw a quad with a size of 512x512 pixels (check your glOrtho), and place carefully the lower left corner of the quad on the corner of the window. glScissor will cut out the wasted parts.

You may want to center the relevant part instead of putting if on a corner, well, you get the idea.

[This message has been edited by ZbuffeR (edited 02-09-2004).]