SDL_IOStreamInterface

The function pointers that drive an SDL_IOStream.

Applications can provide this struct to SDL_OpenIO() to create their own implementation of SDL_IOStream. This is not necessarily required, as SDL already offers several common types of I/O streams, via functions like SDL_IOFromFile() and SDL_IOFromMem().

This structure should be initialized using SDL_INIT_INTERFACE()

Members

Variables

close
bool function(void* userdata) close;

Close and free any allocated resources.

flush
bool function(void* userdata, SDL_IOStatus* status) flush;

If the stream is buffering, make sure the data is written out.

read
size_t function(void* userdata, void* ptr, size_t size, SDL_IOStatus* status) read;

Read up to size bytes from the data stream to the area pointed at by ptr.

seek
Sint64 function(void* userdata, Sint64 offset, SDL_IOWhence whence) seek;

Seek to offset relative to whence, one of stdio's whence values: SDL_IO_SEEK_SET, SDL_IO_SEEK_CUR, SDL_IO_SEEK_END

size
Sint64 function(void* userdata) size;

Return the number of bytes in this SDL_IOStream

version_
Uint32 version_;
Undocumented in source.
write
size_t function(void* userdata, const(void)* ptr, size_t size, SDL_IOStatus* status) write;

Write exactly size bytes from the area pointed at by ptr to data stream.

See Also

SDL_INIT_INTERFACE

Meta