Re: [AD] al_put/draw_pixel() speed

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


On Sat, August 8, 2009 4:35 pm, Matthew Leverton said:
> I'm more curious why ALLEGRO_NO_PRESERVE_TEXTURE had a profound effect
> on D3D.

Well the short of it is, on simple programs that don't do much, that flag will have
a big effect. What it means is that your textures won't be preserved if the device
is "lost".

I really don't like the way it's implemented now but I don't know if there's a better
way. Lost devices are really stupid and I wish D3D handled this sort of thing on its
own. The fact is the device WILL be lost sometimes, whether it's minimizing a window,
tabbing away from a fullscreen app, or starting some program with UAC on Vista.
The way I preserve textures now is to back them up to system memory on each
al_flip_display (if they're modified and they don't have the NO_PRESERVE_TEXTURE
flag set). Open to suggestions of better ways to handle it. Optionally you can do
what other D3D programs do (non-Allegro) and watch for the DISPLAY_LOST/FOUND
events and restore the textures yourself after a FOUND event (though this isn't
very convenient at all).

Trent :{)>




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