Re: [AD] al_put/draw_pixel() speed

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sat, 2009-08-08 at 10:43 +0200, Milan Mimica wrote:
> Matthew Leverton wrote:
> > 
> > Using al_put_pixel() on exactly one pixel of a video bitmap drops my
> > framerate from 350 to 20. (Perhaps the documentation should substitute
> > "worthless" for "slow," heh.) But using al_draw_pixel() doesn't harm
> > the framerate at all, despite the manual saying it will. So why is it
> > so much faster than put_pixel?
> 
> The real question is, why does al_put_pixel() always perform locking, even 
> though the GFX driver might support some kind of drawing to textures?
> 

My understanding always was this:

al_draw_pixel:

* normal drawing function like al_draw_line and so on
* always accelerated
* illegal to use on locked bitmaps

al_put_pixel:

* not a drawing function, just a helper to modify locked regions
* never accelerated
* illegal to use on *non*-locked bitmaps

Also, I think we should make it clear that the only reason to use
locking in A5 is when you want to directly modify RGBA data - so maybe
if you write an image loader or procedurally pre-generate textures. It
never should be used during the mainloop of a game, very much unlike the
A4 concept of "locking".

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/