[SDL] Documention for "file" api

Sam Lantinga slouken at devolution.com
Tue Jun 13 22:32:26 PDT 2000



> hello,

> I was unable to find any documentation on SDL file functions. These
> functions seem to be SDL_rwops.c and SDL_rwops.h. I have looked at the
> source and dont fully understand the SDL_RWops structure. Any documentation
> would be appreciated.

It's modeled very similarly to the stdio API, which is widely documented.

> Also, I am trying to write a program that will display "raw" image data to
> the screen. For example, I have this file format called .SHP (from Command
> & Conquer game) that is a file filled with compressed images. I wrote a
> function to decompress a single image and save the decompressed data
> without a header or anything. Do you have any pointers on how to display
> that type of graphic (it does require a palette also). To link the two
> questions, I noticed heavy use of the SDL_RWops structure in the SDL_Image
> library and though it could prove useful in my problem.

You probably don't need to worry about the file functions.  You should
create an 8-bit SDL surface using the SDL_CreateRGBSurface() function,
and then copy the palette information into an array of SDL_Color structs
and set the palette of the surface with SDL_SetColors().

Try asking on the IRC channel if you need more help, or on the mailing
list if nobody is around.

See ya!
	-Sam Lantinga, Lead Programmer, Loki Entertainment Software



More information about the SDL mailing list