2D Drawing

Hello, I am just wondering if anyone knows how to speed up drawing in OpenGL…

I am building a program that ONLY draws 2D images and text, and I have Depth-Testing disabled and Alpha-test is used only sometimes…and disabled when not in use

The bad thing is that the thing is SO slow!!
I am estimating that it is running at about 20 or 30 FPS, whereas my 3D program (which i was building earlier) ran at 60FPS…

Does anyone know of any way to optimize 2D Drawing? Im in desperate need of some info for this…

Thanks very much

Are you using glDrawPixels and related
bitmap funcitons? Also What platform are you running on?

The reason why I asked these questions is
because of a similar problem we were having
with one of our programs. When using
glDrawPixels in an X windows system every
call has to through the X server, instead
of straight to the hardware, which is
painfully slow.

In order to get around this we just texture
mapped quads and placed them where we wanted
the bitmaps to be. We then used a glOrtho
projection to make sure that they
would not have perspective correction.

Hope this helps.

Harley

Hmmm…that is what I am doing…mapping 2D Quads.

It’s going a lot faster now, but not quite the speed that I would like it at…

Thanks anyway…
maybe I’ll just Emulate 2D by drawing 3D surfaces or something…

Howdy.

I don’t think X- is the cause of the problem with glDrawPixels. You don’t say how you justify the claim that glDrawPixels goes through the X server and eberything else (?!) does not.

One of the concerns using glDrawPixels instead of a textured poly is that the data must be transferred from the processor to graphics memory every time it is called. This is irrespective if you’re using a direct GLX implementation or not. There is scope with textures, on the otherhand, to transfer the bitmap once to texture memory and repeatedly use it by referncing it’s id only. I would imagine if such an extension was implemented for glDrawPixels (ie. to pass a bitmap ID instead of a ptr to the bitmap) then the graphics h/w designers might have better scope to optimise the performance of glDrawPixels.

cheers,
John