Re: [AD] al_get_num_display_modes and al_get_display_mode

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


On Tue, March 17, 2009 10:05 am, Elias Pschernig said:
> So then the user would have to extract R/G/B sizes from that and
> construct calls to al_set_new_display_option? And how would it work with
> windowed modes?
>
> I think we should remove the pixel format.
>
> Then later we could introduce new functions:
>
> int al_get_num_pixel_formats()
> al_get_pixel_format(int i, ALLEGRO_PIXEL_FORMAT *format_info)
> al_set_new_display_pixel_format(int i)
>
> How you would use them in your game:
>
> int width = config.width
> int height = config.height
>
> if (want_fullscreen) {
>    ALLEGRO_DISPLAY_MODE mode;
>    for (int i = 0; i < al_get_num_display_modes(); i++) {
>       al_get_display_mode(i, &mode);
>    }
>    al_set_new_display_refresh_rate(mode.refresh_rate)
> }
>
> for (int i = 0; i < al_get_num_pixel_formats(); i++) {
>    ALLEGRO_PIXEL_FORMAT format;
>    al_get_pixel_format(i, &format);
> }
> al_set_new_display_pixel_format(i);
>
> al_create_display(width, height)
>
> Basically, right now, al_get_display_mode is limited to fullscreen
> modes. However, any pixel format selection is just as relevant if you
> use windowed mode. So we clearly need something better.
>
> With the above, fullscreen modes and pixel formats would be two separate
> things. ALLEGRO_PIXEL_FORMAT in the case of GLX would wrap around GLX
> visuals, that is, each visual would correspond to an
> ALLEGRO_PIXEL_FORMAT, and we would expose as much information as
> possible to users. That way, if they care, they can do their own
> selection of the best video mode. Else they can just use
> al_set_new_display_option() or even better just use the default mode.

Yeah that sounds good except maybe there should be a distinction between
supported pixel formats for displays and those for bitmaps. As far as I can
tell, D3D doesn't support any alpha components for the backbuffer. That
could just be my video cards though, I've tested ati, intel and nvidia cards
and they're all the same that way.

Trent :{)>




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