SDL Wiki
(This is the documentation for SDL3, which is under heavy development and the API is changing! SDL2 is the current stable version!)

SDL_IOFromDynamicMem

Use this function to create an SDL_IOStream that is backed by dynamically allocated memory.

Header File

Defined in <SDL3/SDL_iostream.h>

Syntax

SDL_IOStream* SDL_IOFromDynamicMem(void);

Return Value

Returns a pointer to a new SDL_IOStream structure, or NULL if it fails; call SDL_GetError() for more information.

Remarks

This supports the following properties to provide access to the memory and control over allocations: - SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER: a pointer to the internal memory of the stream. This can be set to NULL to transfer ownership of the memory to the application, which should free the memory with SDL_free(). If this is done, the next operation on the stream must be SDL_CloseIO(). - SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER: memory will be allocated in multiples of this size, defaulting to 1024.

Version

This function is available since SDL 3.0.0.

See Also


CategoryAPI, CategoryAPIFunction


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.