Generating transparent pixels on a surface

This is strange – it works on VNC but doesn’t work on a
real X server (I’m using ubuntu 7.10). I see transparent
pixels on vnc, but black pixels on the X server…

    tmp = IMG_ReadXPMFromArray((char **) control_panel_xpm);
    if (tmp == NULL) {
            fprintf(stderr, "Couldn't load control_panel.xpm: %s\n",
                    SDL_GetError());
            exit(1);
    }
control_panel_image = tmp;
result = SDL_SetColorKey(control_panel_image, SDL_SRCCOLORKEY,
                    SDL_MapRGB(control_panel_image->format, 32, 32, 32));

Afterwards I used SDL_DisplayFormat/SDL_DisplayFormatAlpha, with the same
results ( both didn’t do anything (returned NULL), and it worked on VNC
but not on a real X server.

marty

Is that being used for a blit? Or is it the actual window content? I don’t think that colorkey transparency would work on a window - or even reliably work on a window with RGBA transparency either.

Marty Leisner wrote:> This is strange – it works on VNC but doesn’t work on a

real X server (I’m using ubuntu 7.10). I see transparent
pixels on vnc, but black pixels on the X server…

    tmp = IMG_ReadXPMFromArray((char **) control_panel_xpm);
    if (tmp == NULL) {
            fprintf(stderr, "Couldn't load control_panel.xpm: %s\n",
                    SDL_GetError());
            exit(1);
    }

control_panel_image = tmp;
result = SDL_SetColorKey(control_panel_image, SDL_SRCCOLORKEY,
SDL_MapRGB(control_panel_image->format, 32, 32, 32));

Afterwards I used SDL_DisplayFormat/SDL_DisplayFormatAlpha, with the same
results ( both didn’t do anything (returned NULL), and it worked on VNC
but not on a real X server.

marty


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Forest ‘LordHavoc’ Hale
Author of DarkPlaces Quake1 engine and mod
http://icculus.org/twilight/darkplaces/
Address: 94340 Horton Road Blachly OR 97412
Phone/Fax: 541-925-4130

the colorkey is used on a blitted rectangle…

static void display_control_panel(void)
{
SDL_Rect control_rect;
int result;

    control_rect.x = 0;
    control_rect.y = 0;
    control_rect.w = control_panel_image->w;
    control_rect.h = control_panel_image->h;

    SDL_BlitSurface(control_panel_image, NULL, screen, &control_rect);
    SDL_UpdateRects(screen, 1, &control_rect);

}

I’m at a loss of why it works on VNC but not on a real X server…

marty

Forest Hale writes on Tue, 11 Nov 2008 22:30:50 PST> Is that being used for a blit? Or is it the actual window content? I don’t think that colorkey transparency wo
>uld work on a window - or even reliably work on a window with RGBA transparency either.
>
> Marty Leisner wrote:
> > This is strange – it works on VNC but doesn’t work on a
> > real X server (I’m using ubuntu 7.10). I see transparent
> > pixels on vnc, but black pixels on the X server…
> >
> >
> >
> > tmp = IMG_ReadXPMFromArray((char **) control_panel_xpm);
> > if (tmp == NULL) {
> > fprintf(stderr, “Couldn’t load control_panel.xpm: %s\n”,
> > SDL_GetError());
> > exit(1);
> > }
> > control_panel_image = tmp;
> > result = SDL_SetColorKey(control_panel_image, SDL_SRCCOLORKEY,
> > SDL_MapRGB(control_panel_image->format, 32, 32, 32));
> >
> > Afterwards I used SDL_DisplayFormat/SDL_DisplayFormatAlpha, with the same
> > results ( both didn’t do anything (returned NULL), and it worked on VNC
> > but not on a real X server.
> >
> > marty
> >
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
>
>
> –
> Forest ‘LordHavoc’ Hale
> Author of DarkPlaces Quake1 engine and mod
> http://icculus.org/twilight/darkplaces/
> Address: 94340 Horton Road Blachly OR 97412
> Phone/Fax: 541-925-4130
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org