[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Elias Pschernig wrote:
Anyway, I guess we should copy the visual selection of AllegroGL. The
problem is that it is very complex, using a scoring system I never
understood - but without it, the require/suggested doesn't make sense of
course, right now you can only require multisample, not suggest it.
Done it for WGL. The internal visual selection API is platform independent, all
you have to do is to convert each visual into platform independent format (fill
the ALLEGRO_EXTRA_DISPLAY_SETTINGS structure) and pass it to the scorer, which
will compare it to the one that the user requested. Function
select_pixel_format() from src/win/wgl_disp.c is a good reference of how to do
it, and AGL has all the code.
I can do this for GLX too, but it may take a week or a month.
There are some ambiguities in the API now:
al_set_new_display_flags(ALLEGRO_SINGLEBUFFER) is the same as
al_set_display_option(ALLEGRO_DOUBLEBUFFERED, 0, ALLEGRO_REQUIRE).
al_set_new_display_format(ALLEGRO_SOME_FORMAT) is the same as
al_set_display_option(ALLEGRO_RED_SIZE, r, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_GREEN_SIZE, g, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_BLUE_SIZE, b, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_ALPHA_SIZE, a, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_RED_SHIFT, rs, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_GREEN_SHIFT, gs, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_BLUE_SHIFT, bs, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_ALPHA_SHIFT, as, ALLEGRO_REQUIRE);
al_set_display_option(ALLEGRO_COLOR_SIZE, s, ALLEGRO_REQUIRE);
I say we keep both variants and specify that al_set_display_option() is intended
for advanced users.
Also I think this functions should have a "new" in their name, like this:
void al_set_new_display_option(option, value, importance);
int al_get_new_display_option(option, *importance) //maybe not even necessary
int al_get_display_option(option); //returns an option of the current display
So the the user can find out whether his SUGGESTion was accepted or not.
--
Milan Mimica
http://sparklet.sf.net