Re: [AD] odd sized windows don't work properly?

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


> Should allegro support any resolution in a windowed mode?

Is that really a requirement for a game programming library ?

> set_gfx_mode(GFX_AUTODETECT_WINDOWED, 500,500, 0,0);
>
> Should that work? On my PC, I only can work with what seems to be
> multiples of 8. I didn't do a lot of testing, but there is definately an
> issue here.

The only requirement is that the width be a multiple of 4. No requirement on
the height.

> On some odd sizes, it will not even create a window.

Yes.

> On others, it creates the window, but weird things happen.

Then that's a bug.

> So, is this a bug with Allegro, DirectX, my video card? Or perhaps
> everyone already knows about it?

A design decision, by me, because of speed and consistency issues. Here the
rationale: when the windowed driver is used and the color depth doesn't
match that of the Windows desktop, Allegro automatically adds a color
conversion layer between the driver and the desktop. This layer is written
in pure asm (i386 and MMX if available) and achieves its full speed when all
memory accesses are 4-byte aligned (the MMX code could probably even justify
a 8-byte alignment). Now the only mean to enforce 4-byte alignment across
all supported color depths is to require that the width be a multiple of 4.
Not a big limitation IMHO, and without it the performance penalty can be
50%. Of course, this doesn't apply if the color depths match, but for
consistency (in order to avoid that a program runs on this Windows desktop
and not on that one) the requirement was extended to every color depth.

- Eric



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