Wiki Page Content

Differences between revisions 4 and 5
Revision 4 as of 2010-06-17 04:43:31
Size: 1046
Editor: SheenaSmith
Comment: add content from old wiki (incomplete)
Revision 5 as of 2010-06-24 20:44:52
Size: 1258
Editor: SheenaSmith
Comment: add content from old wiki
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
Use this function to create [[SDL_RWops]] structures from a standard I/O file pointer. Use this function to create an SDL_RWops structure from a standard I/O file pointer.
<<Color2(green,There is currently no page for SDL_RWops so no link.)>>
Line 17: Line 18:
||'''fp'''||^a file pointer used to fill an [[SDL_RWops]] structure^ ???||
||'''autoclose'''||^SDL_TRUE to autoclose or SDL_FALSE to leave the structure open^ ???||
||'''fp'''||^a pointer to the file to open (in the structure ???)^||
||'''autoclose'''||^non-0 to autoclose or 0 to leave the file open when the structure is closed^ ???||
Line 21: Line 22:
*Returns a pointer to a new RWops structure, or NULL  if it fails. * *Returns a pointer to a new RWops structure, or NULL if it fails. *
Line 25: Line 26:
You can add your code example here 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)

DRAFT

SDL_RWFromFP

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

Syntax

SDL_RWops* SDL_RWFromFP(FILE*    fp,
                        SDL_bool autoclose)

Function Parameters

fp

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

autoclose

non-0 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

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