Re: [AD] Docs and set_gfx_mode

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


Christer Sandberg wrote:
- In case the 'card' (card?) parameter is GFX_AUTODETECT_FULLSCREEN it
will, if possible, switch to a resolution as given by the parameters w
and h. It can only succeed if the graphics card of the system where the
program is executing, have the capability to set the requested
resolution. Even if the card has the capability to set the requested
resolution, set_gfx_mode can still fail if the driver that Allegro
choses does not support it.

Allegro doesn't itself "support" modes. You can pass it any resolution you want, and if the card/OS can set it, you can use it in Allegro.

- In case the 'card' parameter is GFX_AUTODETECT_WINDOWED it will, if
possible, create a window. The size of the drawing area in that window
will be as specified by the w and h parameter.
It seems that on my Linux systems arbitrary window sizes can be set
(only memory limitations). Does that apply also for other platforms,
or are there some stricter limitations?

I believe Windows needs window width/height sizes to be a multiple of 4 (4, 8, 12, 16, etc). This is a WinAPI "limitation" which Allegro can't work around.

If I have made correct observations of the behavior (as described
above), then neither of the below statements are correct (copied from
the docs):
"Switches into graphics mode"
"The w and h parameters specify what screen resolution you want"

The meaning of GFX_AUTODETECT is not explained, and it's not very clear
from the name what behavior that should be expected (e.g. will it try
both windowed and full screen mode?, in which order?, what does it
actually autodetect?).

Both of these are hold overs from when Allegro was DOS-only, and windowed modes weren't directly available. GFX_AUTODETECT can be a little tricky to understand, but it's actually simple. It will search the configuration options for the gfx_card variables (including the ones specifying resolutions and detection order) and will succeed when it gets one of the drivers to set a mode, whether it is fullscreen or windowed.

I can't find any info about which colour depth that is used by default
(if set_color_depth is not called).

8-bit. A hold-over from when Allegro only supported 8-bit color.

Also, I can't get the meaning of "colour depth" in windowed mode, when
reading the docs. Experimenting at bit, it seems that the graphics card
keeps its current settings when changing the colour depth.

The depth you specify when using a windowed mode is the depth that the 'screen' BITMAP will use. Allegro will automatically convert it to the proper color depth for the OS driver (some OS drivers will handle this conversion automatically, others won't).

The use of virtual screens is maybe simple, but I don't understand it
(using the docs as the source). Reading the examples ex3buf and exflip
raises the idea that a virtual screen needs to be set up if one want to
create video bitmaps. Is that so?

If ALLEGRO_VRAM_SINGLE_SURFACE is defined, yes.

Also the
description of the usage (scrolling/page flipping) could be improved by
just mention the functions split_modex_screen and scroll_screen.

I don't believe split_modex_screen has any relevance to page flipping. And for certain platforms (Windows), page flipping and scrolling are treated differently (IIRC, Windows doesn't let you scroll, but you can still page flip).

Are
there any differences in windowed and full screen modes concerning
virtual screens?

Don't expect a virtual screen in windowed modes. The X11 driver allows it, but there are drivers that don't.

What is the precise meaning of setting one of the
parameters v_w or v_h to 0?

It means you don't care about the virtual screen size. Some drivers will allocate as little as possible, others will allocate as much as possible.

Please note that I am not in emergent need of the actual knowledge. I
rather want to know where to get the information the day I need it. One
of the reasons is that I am teaching a course where Allegro is suggested
as the platform for the game programming project. One of the first
things for a student to look up in the docs is probably 'set_gfx_mode'.

Most of these things are mentioned in the docs (some aren't, though). Allegro's docs are quite complete, so if the docs don't mention something it's usually a good idea to assume it's not gauranteed/stable behavior and subject to change. That said though, anyone using Allegro should read the docs.. all of them (as relevant to your platform) as it answers many questions that get asked (not necesarilly these questions, but in general).

- Kitty Cat




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