DX Drawimage vs DrawPixmap.

BlitzMax Forums/BlitzMax Programming/DX Drawimage vs DrawPixmap.

tonyg(Posted 2006) [#1]
Hmm, not sure something odd isn't going on.
I recently noticed that drawimage creates a staticpixmap, gets a ptr to each pixel and then copies them to an imageframe (I think).
If so, I wondered what the difference between Drawimage and drawpixmap is. If you're not using any blend modes drawpixmap seems just as fast (maybe faster) than drawimage and loadpixmap is faster than loadimage.
Isn't the pixmap to image process wasteful?
I might have this all wrong so if anybody can put me right (and answer my Defaultfont query here ) I'd be grateful.


skidracer(Posted 2006) [#2]
It's usally a ptr to each line, most pixel pushing done by the drivers is on a line by line basis.

On most systems DrawImage will be free compared to pastepixmap as it simply adds an instruction to a GPU list rather than actually perform a pixel shift across a locked AGP bus.

The first DrawImage of a particular image may trigger the push of pixels from the image's persistant ram pixmap to texture memory so could indeed be slower.

re other thread, unless it's currently broken I unfortunately must be on my way....


ImaginaryHuman(Posted 2006) [#3]
If DrawPixmap is as fast or faster than DrawImage, for you, then either you have a software-only graphics driver, or a very poor graphics card. It should be many times faster to DrawImage.


tonyg(Posted 2006) [#4]
Skid, yep you're right.
I guess the only difference between loadimage and loadimage(loadpixmap) then is the extra pixmap not being deleted.
@AngleDaniel, not for the first draw of each image. If you load 20 images those 20 images will be converted (line copied as per Skid's response) from pixmaps to images the first time they are drawn.