SDL_FillRect and alpha

Should I be able to SDL_MapRGB from a pixel format having an alpha value
then SDL_FillRect, getting the same alpha value for the fill, or not?–
SmokeSerpent <@Benjamin_Moos>
“The purpose of writing is to inflate weak ideas, obscure pure reasoning,
and inhibit clarity. With a little practice, writing can be an
intimidating and impenetrable fog!” – Calvin

Should I be able to SDL_MapRGB from a pixel format having an alpha value
then SDL_FillRect, getting the same alpha value for the fill, or not?

Use SDL_MapRGBA(), that’s exactly what it’s for. :slight_smile:

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

Should I be able to SDL_MapRGB from a pixel format having an alpha value
then SDL_FillRect, getting the same alpha value for the fill, or not?

Use SDL_MapRGBA(), that’s exactly what it’s for. :slight_smile:

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Oh.
I did not have documention of this function.
However, I am trying this now, but not achieving an alpha effect with
FillRect. Maybe someone can offer a short example of usage if it isn’t too
much trouble?–
SmokeSerpent <@Benjamin_Moos>
“The purpose of writing is to inflate weak ideas, obscure pure reasoning,
and inhibit clarity. With a little practice, writing can be an
intimidating and impenetrable fog!” – Calvin