I'm having problems converting a FIBITMAP to SDL_Surface.
heres the function:
It gives me a surface of the specified size, but the image is all messed up.Code:SDL_Surface *FiBitmapToSdlSurface(FIBITMAP *fb) { int h = FreeImage_GetHeight(fb), w = FreeImage_GetWidth(fb); SDL_Surface* surf = SDL_CreateRGBSurfaceFrom(FreeImage_GetBits(fb), w, h, 32, w * 3, 0xff0000, 0x00ff00, 0x0000ff, 0); return surf; }
Help would be appreciated.