[SDL] need help with SDL_CreateRGBSurfaceFrom

Matt Bentley moc.pophot at hotpop.com
Tue Aug 22 13:49:21 PDT 2006


I don't think that kind of color was intended for use with 
CreateRBGSurfaceFrom. You would be better off writing a short loop, 
using an already-created RGB surface and MapRGB to map the colours 
appropriately-
M at T

Freyr Magnússon wrote:
> I´m having trouble getting this function to work for me
> 
> I have a 176x144 intensity (IR) image with 2 bytes per pixel and I'm 
> trying to create a grayscale surface to blit to screen
> 
> SDL_Surface* image = SDL_CreateRGBSurfaceFrom( data,
>         176,
>         144,
>         16,
>         2*176,
>         0x0000ff00,
>         0x0000ff00,
>         0x0000ff00,
>         0x00000000);
> 
> this call failes and everytime. I've tried to mess around with the masks 
> but that doesn]t change anything
> 
> any input is welcomed
> 
> regards,
> Freyr
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl




More information about the SDL mailing list