Need help with SDL_CreateRGBSurfaceFrom

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

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