Re: [AD] Multiple window icons

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


On Sat, 13 Oct 2012 12:51:16 +0200, Elias Pschernig <info@xxxxxxxxxx> wrote:
> On Sat, 13 Oct 2012 14:56:35 +1100
> Peter Wang <novalazy@xxxxxxxxxx> wrote:
> 
> > Hi,
> > 
> > Allegro doesn't support multiple window icons at the moment.
> > Here is a possibility:
> > 
> >     bool al_set_display_icons(ALLEGRO_DISPLAY *display,
> > 	int num_icons, ALLEGRO_BITMAP *icons[]);
> > 
> > where num_icons >= 1.
> > 
> > On some systems, Allegro may just pass converted but otherwise
> > unscaled images through to the window environment, and let it choose
> > the appropriate one for whatever context (taskbar, alt-tab selector,
> > etc.)
> > 
> > On other systems, Allegro may use an exact size bitmap if possible or
> > upscale the next smallest bitmap to the size required by the
> > environment.  I assume scaling up is preferable to scaling down at
> > icon resolutions.
> > 
> > How does that sound?
> > 
> 
> I think scaling down works best. All our icons were made by scaling
> down a 512x512 pixel bitmap (and I think in many cases Apple just
> scales down that bitmap themselves - but not sure).

It depends on the resolutions and the scaling algorithm.

al_set_display_icon scaling down a 32x32 icon to 16x16 can make for an
incomprehensible mess: it just drops 3/4 pixels after all.  On the other
hand scaling up the 16x16 icon to 32x32 gains nothing, but loses nothing
either.

> And I don't know anything about Window icons, so if on some platform
> multiple sizes make sense, that function sounds good.

Windows supports at least two sizes, and X11 supports multiple
(run xprop and click on Firefox or Chrome, for example).

Peter




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