SDL_LoadBMP_RW question

I have an SDL_RWops* that I load a bitmap into with SDL_RWFromFile.
I can convert it to a surface with SDL_LoadBMP_RW. The problem I am
having is that I can’t load it to another surface later to have two
surfaces generated from the same RW. Even when I pass 0
SDL_LoadBMP_RW as freesrc, I get an “error reading from datastream”.
Debugging tells me the RW is still open. Any help would be great.

thanks,
ryan

I have an SDL_RWops* that I load a bitmap into with SDL_RWFromFile.
I can convert it to a surface with SDL_LoadBMP_RW. The problem I am
having is that I can’t load it to another surface later to have two
surfaces generated from the same RW. Even when I pass 0
SDL_LoadBMP_RW as freesrc, I get an “error reading from datastream”.
Debugging tells me the RW is still open. Any help would be great.

SDL_LoadBMP_RW (and the RWops-loading functions in SDL_image) cannot read
several image from the same RW stream. We could fix this (use only relative
seeking etc) but only to some extent — some image formats append an
arbitrary amount of trailing junk so it can be hard to know exactly how
much to skip. This means that you can’t just cat your images together
to one big file without some kind of indexing or size information

Better pass different RWs to the functions, each of which appear as separate
files (in terms of seeking etc)