News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

2D Drawing using OpenGL

Started by johnsa, August 14, 2006, 02:33:48 PM

Previous topic - Next topic

johnsa

Hi all,

Just curious with regards to what would be the best way to do pure 2D drawing optimally through OpenGL?
Example: Sprites, old style demo effects like plasmas etc.. anything which needs to rendered pixel by pixel and then draw to screen.
I've used DirectDraw before to do 2D stuff via ASM, I'm not that keen on trying to work with DirectX in ASM as from v10 it will only work on Vista, the Open GL calls are much cleaner not having all the COM stuff with it.

Thanks!

hitchhikr

glDrawPixels is the simplest way.

johnsa

Thanks,

But would that be particularly fast? Or would it be faster to render to a texture and draw a quad to screen, or some other sneaky trick ?

hitchhikr

It can be extremely slow as constantly transfering a big amount of datas from the main memory to the agp one can cause major slowdowns.
It depends on the effect you're wanting to achieve, for drawing bitmap sprites you may want to preload all the bitmaps in the video card memory as textures beforehand, dynamically drawing to textures is acheived with pbuffers and is generally to draw completes scenes offscreen.