[SDL] SDL_CreateSurfaceFrom crashes (was: Alpha transparency on created surface?)

Brian brian.ripoff at gmail.com
Thu Aug 9 01:09:20 PDT 2007


SDL returns surfaces as pointers for a various reasons, it is best to
store surfaces in your own programs as pointers too.

SDL_CreateRGBSurfaceFrom expects "tpixel->pixels" to contain at least
"w" x "h" pixels, is this the case? Are "w" and "h" both 1?

On 09/08/07, L-28C <kixdemp at gmail.com> wrote:
> Well, since nobody seemed to have the answer the previous question, I
> loaded up a 1x1 transparent PNG called 'tpixel' and  did this:
>
> base = *SDL_CreateRGBSurfaceFrom(tpixel->pixels, w, h,
>         tpixel->format->BitsPerPixel, tpixel->pitch, 0, 0, 0, 0);
>
> (note the * before the function call; 'base' is not a pointer)
>
> It crashes right there... Am I using the function wrongly? o_O
>
> Thanks people!
>
> L-28C wrote:


More information about the SDL mailing list