Tao.Sdl SDK Documentation

Sdl.SDL_RWFromFP Method 

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.

[Visual Basic]
Public Shared Function SDL_RWFromFP( _
   ByVal fp As IntPtr, _
   ByVal autoclose As Integer _
) As IntPtr
[C#]
public static IntPtr SDL_RWFromFP(
   IntPtr fp,
   int autoclose
);

Parameters

fp
autoclose

Return Value

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

Remarks

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

Example

            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)
            

See Also

Sdl Class | Tao.Sdl Namespace | SDL_RWFromFile