PDA

View Full Version : Loading files and OpenGL



d98ped
08-29-2001, 07:02 AM
Hello!
I want to load images and use them as bitmaps in opengl, whats the easiest approach?

Say I have a .bmp file and want to use it with the glDrawPixels-function, how do I do?

Qwylli
08-31-2001, 10:24 PM
YOu should not use glDrawPixels, it's toooo sloow!!!!

d98ped
08-31-2001, 11:53 PM
Okay, what should I use instead?

Qwylli
09-02-2001, 05:47 AM
glBindTexture
glTexCoord2f
etc
They are faster (a lot) than glDrawPixels.

Gavin
09-03-2001, 02:44 AM
They are faster but they only take 2^n images so, assuming his bmp is a random size, you need to pad the image and then scale it to your quad, this also makes them slow to load. If they don't need to be drawin quickly (i.e. just a bmp viewer) then drawpixels is a lot less hassle and they load quicker....

gav