Wiki Page Content

Differences between revisions 11 and 12
Revision 11 as of 2010-10-13 18:45:38
Size: 1398
Editor: SheenaSmith
Comment: update content - pointers, structs
Revision 12 as of 2011-01-13 05:02:02
Size: 1401
Editor: SheenaSmith
Comment: update content for consistency - non-zero
Deletions are marked like this. Additions are marked like this.
Line 22: Line 22:
||'''autoclose'''||^non-0 to autoclose or 0 to leave the file open when the structure is closed^ ???|| ||'''autoclose'''||^non-zero to autoclose or 0 to leave the file open when the structure is closed^ ???||

DRAFT

SDL_RWFromFP

Use this function to create an SDL_RWops structure from a standard I/O file pointer.

Syntax

#ifdef HAVE_STDIO_H
SDL_RWops* SDL_RWFromFP(FILE*    fp,
                        SDL_bool autoclose)
#else
SDL_RWops* SDL_RWFromFP(void*    fp,
                        SDL_bool autoclose)

Function Parameters

fp

a pointer to the file to open (in the new structure ???)

autoclose

non-zero to autoclose or 0 to leave the file open when the structure is closed ???

Return Value

*
Returns a pointer to a new RWops structure, or NULL if it fails.
*

Code Examples

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)

Remarks

You can add useful comments here

*
This is not available under Win32, since files opened in an application on that platform cannot be used by a dynamically linked library.
*


CategoryAPI, CategoryIO

None: SDL_RWFromFP (last edited 2015-06-20 19:58:46 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit