Re: [AD] mode list patch committed.

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


Laurence Withers <lwithers@xxxxxxxxxx> writes:
>> BTW! would you like this function to check if there is enough video 
>> memory to set the desired mode? this will of course rely on the driver 
>> ALWAYS reporting the correct amount of memory, which IIRC is not 
>> always the case.
> 
> I would probably support this. It seems cleaner to determine the amount
> of video RAM and, from that, choose the graphics mode and method (ie.
> are sprites kept in video RAM? etc). There is also no portable way of
> doing this, and abstraction through Allegro would provide this.

I don't think it's possible. Video memory layout often has to follow much 
more complicated rules than just "is w*h*bpp less than the total amount 
of vram", so any system based on just testing a single number is sure to 
fail in some situations. Most cards have weird size restrictions that 
will cause some images to be padded, or may be able to interleave data in 
strange ways (especially for 3d textures, which can be used to implement 
vram sprites, memory layout is often a long way away from linear). Since 
you can't know what clever allocation methods the driver might be using 
to try to fit your images into whatever weird rules the hardware imposes, 
unfortunately there really isn't any solution other than just to try it 
and see if it works.

Even just setting a video mode can have results other than you would 
expect (eg. Allegro won't be able to set an 800x600x16bpp mode on a 1 meg 
card that uses a banked addressing mode), and when you come to 
downloading sprites to vram, it gets even less predictable.


    Shawn.



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