SDL RWops and png

With SDL_image, yes.
But core SDL package only provides facilities for bitmaps.

Look here: http://www.libsdl.org/projects/SDL_image/docs/SDL_image_12.html

nfries88 wrote:

With SDL_image, yes.
But core SDL package only provides facilities for bitmaps.

Look here: http://www.libsdl.org/projects/SDL_image/docs/SDL_image_12.html

thanks!!------------------------
http://mandarx.xoom.it/index.php?lang=eng

SDL 1.2 does not support alpha channels, it at most supports color keys (a color that represents full transparency).

Then what is SDL_SRCALPHA for?On Tue, Mar 2, 2010 at 12:40 PM, nfries88 wrote:

SDL 1.2 does not support alpha channels, it at most supports color keys (a
color that represents full transparency).


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

Jeremiah wrote:

Then what is SDL_SRCALPHA for?

SDL 1.2 does not support alpha channels, it at most supports color keys (a
color that represents full transparency).

Per-surface alpha. SDL 1.2 does not support per-pixel alpha channels (or, at the very least, appears to ignore them when rendering).> On Tue, Mar 2, 2010 at 12:40 PM, nfries88 <@Nathaniel_J_Fries> wrote:

It does support per-pixel alpha. It does not support much in the way of
blending modes. Destination alpha is preserved, so if you alpha blend to a
transparent region on an RGBA surface, then you can’t see the result. Maybe
this has happened to you?

Jonny DOn Tue, Mar 2, 2010 at 2:26 PM, nfries88 wrote:

Jeremiah wrote:

Then what is SDL_SRCALPHA for?

On Tue, Mar 2, 2010 at 12:40 PM, nfries88 <> wrote:

Quote:

SDL 1.2 does not support alpha channels, it at most supports color keys
(a
color that represents full transparency).

Per-surface alpha. SDL 1.2 does not support per-pixel alpha channels (or,
at the very least, appears to ignore them when rendering).


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

Jonny D wrote:

It does support per-pixel alpha. ?It does not support much in the way of blending modes. ?Destination alpha is preserved, so if you alpha blend to a transparent region on an RGBA surface, then you can’t see the result. ?Maybe this has happened to you?

Jonny D

No. maybe I just did something wrong. I didn’t really need it and ended up just using the colorkey anyway.

mandarx wrote:

if I load it in this way:

Code:
fseek(FileInWhichThePNGIsStored, OffsetOfMyPNG, SEEK_SET);
fread(pBuffer, sizeof(char), PNGFileLenght, FileInWhichThePNGIsStored);
SDL_RWops *rw = SDL_RWFromMem(pBuffer, PNGFileLenght);
SDL_Surface *temp = IMG_Load_RW(rw, 1);

the png seems to lose the alpha channel

YES!!! because I used image = SDL_DisplayFormat(temp); instead of image = SDL_DisplayFormatAlpha(temp);

now it works!!!------------------------
http://mandarx.xoom.it/index.php?lang=eng