SDL 3.0
|
#include <SDL_iostream.h>
Data Fields | |
Sint64(* | size )(void *userdata) |
Sint64(* | seek )(void *userdata, Sint64 offset, SDL_IOWhence whence) |
size_t(* | read )(void *userdata, void *ptr, size_t size, SDL_IOStatus *status) |
size_t(* | write )(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status) |
SDL_bool(* | close )(void *userdata) |
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().
Definition at line 88 of file SDL_iostream.h.
SDL_bool(* SDL_IOStreamInterface::close) (void *userdata) |
Close and free any allocated resources.
The SDL_IOStream is still destroyed even if this fails, so clean up anything even if flushing to disk returns an error.
Definition at line 137 of file SDL_iostream.h.
size_t(* SDL_IOStreamInterface::read) (void *userdata, void *ptr, size_t size, SDL_IOStatus *status) |
Read up to size
bytes from the data stream to the area pointed at by ptr
.
On an incomplete read, you should set *status
to a value from the SDL_IOStatus enum. You do not have to explicitly set this on a complete, successful read.
Definition at line 115 of file SDL_iostream.h.
Sint64(* SDL_IOStreamInterface::seek) (void *userdata, Sint64 offset, SDL_IOWhence whence) |
Seek to offset
relative to whence
, one of stdio's whence values: SDL_IO_SEEK_SET, SDL_IO_SEEK_CUR, SDL_IO_SEEK_END
Definition at line 103 of file SDL_iostream.h.
Sint64(* SDL_IOStreamInterface::size) (void *userdata) |
Return the number of bytes in this SDL_IOStream
Definition at line 95 of file SDL_iostream.h.
size_t(* SDL_IOStreamInterface::write) (void *userdata, const void *ptr, size_t size, SDL_IOStatus *status) |
Write exactly size
bytes from the area pointed at by ptr
to data stream.
On an incomplete write, you should set *status
to a value from the SDL_IOStatus enum. You do not have to explicitly set this on a complete, successful write.
Definition at line 127 of file SDL_iostream.h.