Loading files and OpenGL

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?

YOu should not use glDrawPixels, it’s toooo sloow!!!

Okay, what should I use instead?

glBindTexture
glTexCoord2f
etc
They are faster (a lot) than glDrawPixels.

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

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.