My Project
|
Go to the source code of this file.
Classes | |
struct | SDL_RWops |
Macros | |
#define | SDL_RWOPS_UNKNOWN 0U |
#define | SDL_RWOPS_WINFILE 1U |
#define | SDL_RWOPS_STDFILE 2U |
#define | SDL_RWOPS_JNIFILE 3U |
#define | SDL_RWOPS_MEMORY 4U |
#define | SDL_RWOPS_MEMORY_RO 5U |
#define | RW_SEEK_SET 0 |
#define | RW_SEEK_CUR 1 |
#define | RW_SEEK_END 2 |
#define | SDL_LoadFile(file, datasize) SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1) |
Read/write macros | |
Macros to easily read and write from an SDL_RWops structure. | |
#define | SDL_RWsize(ctx) (ctx)->size(ctx) |
#define | SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) |
#define | SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) |
#define | SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) |
#define | SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) |
#define | SDL_RWclose(ctx) (ctx)->close(ctx) |
Typedefs | |
typedef struct SDL_RWops | SDL_RWops |
Functions | |
DECLSPEC SDL_RWops *SDLCALL | SDL_AllocRW (void) |
DECLSPEC void SDLCALL | SDL_FreeRW (SDL_RWops *area) |
DECLSPEC void *SDLCALL | SDL_LoadFile_RW (SDL_RWops *src, size_t *datasize, int freesrc) |
RWFrom functions | |
Functions to create SDL_RWops structures from various data streams. | |
DECLSPEC SDL_RWops *SDLCALL | SDL_RWFromFile (const char *file, const char *mode) |
DECLSPEC SDL_RWops *SDLCALL | SDL_RWFromFP (FILE *fp, SDL_bool autoclose) |
DECLSPEC SDL_RWops *SDLCALL | SDL_RWFromMem (void *mem, int size) |
DECLSPEC SDL_RWops *SDLCALL | SDL_RWFromConstMem (const void *mem, int size) |
Read endian functions | |
Read an item of the specified endianness and return in native format. | |
DECLSPEC Uint8 SDLCALL | SDL_ReadU8 (SDL_RWops *src) |
DECLSPEC Uint16 SDLCALL | SDL_ReadLE16 (SDL_RWops *src) |
DECLSPEC Uint16 SDLCALL | SDL_ReadBE16 (SDL_RWops *src) |
DECLSPEC Uint32 SDLCALL | SDL_ReadLE32 (SDL_RWops *src) |
DECLSPEC Uint32 SDLCALL | SDL_ReadBE32 (SDL_RWops *src) |
DECLSPEC Uint64 SDLCALL | SDL_ReadLE64 (SDL_RWops *src) |
DECLSPEC Uint64 SDLCALL | SDL_ReadBE64 (SDL_RWops *src) |
Write endian functions | |
Write an item of native format to the specified endianness. | |
DECLSPEC size_t SDLCALL | SDL_WriteU8 (SDL_RWops *dst, Uint8 value) |
DECLSPEC size_t SDLCALL | SDL_WriteLE16 (SDL_RWops *dst, Uint16 value) |
DECLSPEC size_t SDLCALL | SDL_WriteBE16 (SDL_RWops *dst, Uint16 value) |
DECLSPEC size_t SDLCALL | SDL_WriteLE32 (SDL_RWops *dst, Uint32 value) |
DECLSPEC size_t SDLCALL | SDL_WriteBE32 (SDL_RWops *dst, Uint32 value) |
DECLSPEC size_t SDLCALL | SDL_WriteLE64 (SDL_RWops *dst, Uint64 value) |
DECLSPEC size_t SDLCALL | SDL_WriteBE64 (SDL_RWops *dst, Uint64 value) |
This file provides a general interface for SDL to read and write data streams. It can easily be extended to files, memory, etc.
#define RW_SEEK_CUR 1 |
Seek relative to current read point
#define RW_SEEK_END 2 |
Seek relative to the end of data
#define RW_SEEK_SET 0 |
Seek from the beginning of data
#define SDL_LoadFile | ( | file, | |
datasize | |||
) | SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1) |
Load an entire file.
Convenience macro.
#define SDL_RWOPS_JNIFILE 3U |
Android asset
#define SDL_RWOPS_MEMORY 4U |
Memory stream
#define SDL_RWOPS_MEMORY_RO 5U |
Read-Only memory stream
#define SDL_RWOPS_STDFILE 2U |
Stdio file
#define SDL_RWOPS_UNKNOWN 0U |
Unknown stream type
#define SDL_RWOPS_WINFILE 1U |
Win32 file
DECLSPEC void* SDLCALL SDL_LoadFile_RW | ( | SDL_RWops * | src, |
size_t * | datasize, | ||
int | freesrc | ||
) |
Load all the data from an SDL data stream.
The data is allocated with a zero byte at the end (null terminated)
If datasize
is not NULL, it is filled with the size of the data read.
If freesrc
is non-zero, the stream will be closed after being read.
The data should be freed with SDL_free().