Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » blit vs draw_sprite

This thread is locked; no one can reply to it. rss feed Print
blit vs draw_sprite
Daniel Stori
Member #6,056
July 2005
avatar

Someday I read in this forum or in another that draw_sprite works faster than blit.

I like to know if this is really true and if it is, why?

In my mind, if draw_sprite has the preoccupation with transparency, it need to be slowly.

Thanx ;)

clovekx
Member #3,479
April 2003
avatar

hmm, you should test it if it's true and let us know

miran
Member #2,407
June 2002

Yes, draw_sprite is probably a little bit faster than blit, but if you compare draw_sprite with masked_blit, there shouldn't be much difference.

--
sig used to be here

clovekx
Member #3,479
April 2003
avatar

so masked_blit is faster than normal blit?

HoHo
Member #4,534
April 2004
avatar

Let's see ...
http://www.allegro.cc/forums/view_thread.php?_id=477775#target

It seems like blit is faster than draw_sprite, at least on P4 that is

Of cource draw_rle_sprite in C-only and 32/16 bit would be about twice as fast, compiled sprite ~4x faster than plain blit :P

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

miran
Member #2,407
June 2002

Bleh, typo, I meant the other way around. Normal blit should be a little faster than draw_sprite and masked_blit. At least that's what common sense dictates...

--
sig used to be here

Thomas Harte
Member #33
April 2000
avatar

Quote:

Bleh, typo, I meant the other way around. Normal blit should be a little faster than draw_sprite and masked_blit. At least that's what common sense dictates...

If we're talking about draw_sprite such that it has exactly the same effect as blit (i.e. drawing a sprite with no transparent sections) then I would imagine they'd be the same speed, as if the CPU is doing them then the bottleneck is the memory bandwidth. Conversely if the graphics card is doing them then I would imagine they'd be the same speed as a natural effect of the way hardware is implemented for these things.

If however the sprite is 'substantially' smaller than the area of the bitmap containing it, I would expect draw_sprite to overtake blit for the same bottleneck reason as above.

What do the empirical results show?

Go to: