Re: [AD] GFX_WINDOWED

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


> Since we have 3 windowed modes under Windows and one under Linux (that
> isn't autodetected in preference of fullscreen), I was wondering if the
> idea of a GFX_WINDOWED for set_gfx_mode might be a good idea.  I
personally

Well, actually also BeOS has a windowed driver =P
In any case, I was thinking about similar issues a while ago... My thought
went to the possibility to OR some flags to the driver id into
set_gfx_mode(). These flags could be GFX_WINDOWED (to force windowed mode)
or also GFX_FULLSCREEN (to force fullscreen mode).
When no flag is specified, it should mean you don't care if your app runs
windowed or fullscreen at all, and Allegro selects the best available one.
If one of windowed or fullscreen flag is set and mode is not available, the
function should return error; for example if you try to use a driver with
fullscreen flag on, and that same driver is only available in windowed mode,
you get an error.

Well, this system opens new possibilities to the gfx mode selection, but the
problem with it is the current gfx driver id definition. Currently you pass
a 32 bit value to it, and this is always (AFAIK, correct me if I'm wrong)
generated using the 4 chars method via the AL_ID macro you probably know.
This means the id number can be anything, and you can't assume some bits to
be free for flags usage... except... bit 7, 15, 23 and 31.
This is because you probably never use a char into the AL_ID macro whose
ascii value is bigger than 127 (thus depending on codepages), so I think
these bits can be safely used for 4 possible flags.

If this system is ever applied, we'd end up with the cool option to use

set_gfx_mode(GFX_AUTODETECT | GFX_FULLSCREEN, 640, 480, 0, 0);

still maintaining compatibility with the past... Probably this would also
need some work on parts of the lib other than set_gfx_mode(), as with this
system it would be possible to have the same gfx driver run in fullscreen
and windowed, depending on the flags.

just my 2c

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com



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