Re: [AD] Some windows stuff

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


Isaac Cruz <icruzbal@xxxxxxxxxx> writes:
> from TODO.txt:
> >  windows crash bug involving sub-bitmap locking and hardware acceleration
> 
> The problem was an incorrect pairing of _enter_gfx_critical() and
> _leave_gfx_critical(), (in gfx_directx_autolock(), _leave_gfx_critical was
> called twice).

Aha! I spent way too many hours staring at that code, but I was so 
convinced that the problem must be with the surface lock/release that I 
never even thought to consider those critical section routines. Well done!

> <MSDN>
> If a thread calls LeaveCriticalSection when it does not have ownership 
> of the specified critical section object, an error occurs that may cause 
> another thread using EnterCriticalSection to wait indefinitely.
> </MSDN>

Hehe, that's a nice wording. It didn't really crash, it was just waiting 
indefinitely :-)

> >  implement desktop_color_depth() in Windows
> 
> implemented through GDI. Note that it doesn't distinguish between 15 and 
> 16 bits, but it's not a problem if you try both (DX window driver will 
> only work with the correct)

It would be nice if could detect it accurately enough that you could just 
do a set_color_depth(desktop_color_depth()), but for some reason it seems 
to be really hard to tell the difference between 15 and 16 bpp in Windows. 
Ah well.

Anyway, this looks great, many thanks...



-- 
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



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