glDrawPixels vs. textured quads

BlitzMax Forums/OpenGL Module/glDrawPixels vs. textured quads

SystemError51(Posted 2012) [#1]
Hi all,

just to get some clarification on this. I'm working on a UI for my engine, and it requires a few small images (everything else is done through OpenGL directly).

These images are not big, biggest are 30x20 px (in the moment).

Question is - will there be any noticeable performance impact when using glDrawPixels on small-scale images, or should I still use quads?

I know that glDrawPixels is constantly reading from RAM and beaming the data into VRAM


AdamRedwoods(Posted 2012) [#2]
Your choice, although if you add more and more, then it will be better to use quads. Remember, quad textures are in video memory, glDrawPixels is a system memory to buffer copy.

If you make a pixel buffer, you can speed this up, but pixel buffers are a little obscure and not really used anymore.
http://www.songho.ca/opengl/gl_pbo.html
http://www.opengl.org/wiki/Pixel_Buffer_Object

Instead, Framebuffer Objects are used these days.

Last edited 2012


ImaginaryHuman(Posted 2012) [#3]
Quads will always be many times faster than DrawPixels. DrawPixels has to send all of the pixel data over the graphics bus. It doesn't matter how much data there is, drawing a quad with a texture already in vram should always be much faster. In a test I did years ago DrawImage was at least 10 times faster than DrawPixmap (which uses glDrawPixels).


SystemError51(Posted 2012) [#4]
I've changed my engine so that it uses textured quads for the 2D elements. Makes quite a difference.