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

Lilith Calbridge lilith at dcccd.edu
Wed Aug 8 22:24:49 PDT 2007



>>> On 8/9/2007 at 12:16 AM, Bill Kendrick <nbs at sonic.net> wrote:
> On Wed, Aug 08, 2007 at 09:34:45PM -0400, L-28C wrote:
>> 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)
 
> Uh - why?

The asterisk is de-referencing the pointer returned by the function. 
That means the right side of the equate resolves to a surface structure.
 If base is a surface structure then you'd also have to have an overload
defined for operator=.

-- 
Lilith


More information about the SDL mailing list