Converting PNG's

Hi
I have noticed that if i convert surfaces to screen->format, i get a huge
increase in speed from my game, which works fine for the backgrounds.

i am using PNG images for my sprites as they give me nice anti aliased edges
but when i use SDL_ConvertSurface on the PNG’s i lose my transparency’s,
so how can i convert the sprites to screen->format and still retain the
transparency and the anti-aliasing on the edges?
Many Thanks

Trish

Hello,

Presumably you’re using SDL_DisplayFormat() to convert to the display
format. Does SDL_DisplayFormatAlpha() do the trick for your surfaces with
alpha?

Pete

“Patricia Curtis” <patricia.curtis at gmail.com> wrote in message
news:…> Hi

I have noticed that if i convert surfaces to screen->format, i get a
huge
increase in speed from my game, which works fine for the backgrounds.

i am using PNG images for my sprites as they give me nice anti aliased
edges
but when i use SDL_ConvertSurface on the PNG’s i lose my transparency’s,
so how can i convert the sprites to screen->format and still retain the
transparency and the anti-aliasing on the edges?
Many Thanks

Trish

Le mercredi 9 ao?t 2006 09:44, Patricia Curtis a ?crit?:

Hi
I have noticed that if i convert surfaces to screen->format, i get a
huge increase in speed from my game, which works fine for the backgrounds.

i am using PNG images for my sprites as they give me nice anti aliased
edges but when i use SDL_ConvertSurface on the PNG’s i lose my
transparency’s, so how can i convert the sprites to screen->format and
still retain the transparency and the anti-aliasing on the edges?
Many Thanks

Trish

Perhaps you should use SDL_DisplayFormat or SDL_DisplayFormatAlpha to convert
your sprites to display format.

Otherwise tou can enable alpha later with SDL_SetAlpha++