Fastest method to draw pixels on screen!

Hey!

I’ve been using OpenGL’s glDrawPixels to draw images on screen in my application. What is the fastest way to do it? Right now Im working with an array of images that I’ve loaded to memory then I pass them to glDrawPixels…is there any other way to do this? Im looking for speed cause Im using it in a flipbook app.

Thanks!

/Joda

glDrawPixels is slow, if you use it every frame, as it always reads the image data from host memory. It’s faster to upload your image in form of a texture to video memory once and then render a textured quad every frame.

Hey!

Okey, is there any tutorial on how to do this, basically the only thing I need is the abillity to Zoom which is use to use with a glPixelZoom command.

A code sample would be great!

Thanks for the reply!

  • Joda

Originally posted by Asgard:
glDrawPixels is slow, if you use it every frame, as it always reads the image data from host memory. It’s faster to upload your image in form of a texture to video memory once and then render a textured quad every frame.



before you draw your quad:
glScalef(1,2,1);