SDL_RWFromFP creates a new SDL_RWops structure from a file pointer, opened with stdio. If autoclose is nonzero, the file will be automatically closed when the RWops structure is closed.
Returns pointer to a new RWops structure, or NULL if it fails.
This is not available under Win32, since files opened in an application on that platform cannot be used by a dynamically linked library.
FILE *fp; SDL_RWops *rw; fp = fopen("myfile.dat", "rb"); rw = SDL_RWFromFP(fp, 1); // Do things with rw... SDL_RWclose(rw); // Automatically does an fclose(fp)
Sdl Class | Tao.Sdl Namespace | SDL_RWFromFile