Add properties to SDL_IOStreams returned by IOFromMem
This commit is contained in:
parent
1bb7e2b1a8
commit
a0de6c4abf
2 changed files with 29 additions and 0 deletions
|
@ -291,6 +291,13 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromFile(const char *file, cons
|
|||
* buffer, you should use SDL_IOFromConstMem() with a read-only buffer of
|
||||
* memory instead.
|
||||
*
|
||||
* The following properties will be set at creation time by SDL:
|
||||
*
|
||||
* - `SDL_PROP_IOSTREAM_MEMORY_POINTER`: this will be the `mem` parameter that
|
||||
* was passed to this function.
|
||||
* - `SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER`: this will be the `size` parameter
|
||||
* that was passed to this function.
|
||||
*
|
||||
* \param mem a pointer to a buffer to feed an SDL_IOStream stream.
|
||||
* \param size the buffer size, in bytes.
|
||||
* \returns a pointer to a new SDL_IOStream structure or NULL on failure; call
|
||||
|
@ -308,6 +315,9 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromFile(const char *file, cons
|
|||
*/
|
||||
extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromMem(void *mem, size_t size);
|
||||
|
||||
#define SDL_PROP_IOSTREAM_MEMORY_POINTER "SDL.iostream.memory.base"
|
||||
#define SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER "SDL.iostream.memory.size"
|
||||
|
||||
/**
|
||||
* Use this function to prepare a read-only memory buffer for use with
|
||||
* SDL_IOStream.
|
||||
|
@ -325,6 +335,13 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromMem(void *mem, size_t size)
|
|||
* If you need to write to a memory buffer, you should use SDL_IOFromMem()
|
||||
* with a writable buffer of memory instead.
|
||||
*
|
||||
* The following properties will be set at creation time by SDL:
|
||||
*
|
||||
* - `SDL_PROP_IOSTREAM_MEMORY_POINTER`: this will be the `mem` parameter that
|
||||
* was passed to this function.
|
||||
* - `SDL_PROP_IOSTREAM_MEMORY_SIZE_NUMBER`: this will be the `size` parameter
|
||||
* that was passed to this function.
|
||||
*
|
||||
* \param mem a pointer to a read-only buffer to feed an SDL_IOStream stream.
|
||||
* \param size the buffer size, in bytes.
|
||||
* \returns a pointer to a new SDL_IOStream structure or NULL on failure; call
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue