SDL Wiki
(This is the documentation for SDL3, which is the current stable version. SDL2 was the previous version!)

SDL_OpenIO

Create a custom SDL_IOStream.

Header File

Defined in <SDL3/SDL_iostream.h>

Syntax

SDL_IOStream * SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata);

Function Parameters

const SDL_IOStreamInterface * iface the interface that implements this SDL_IOStream, initialized using SDL_INIT_INTERFACE().
void * userdata the pointer that will be passed to the interface functions.

Return Value

(SDL_IOStream *) Returns a pointer to the allocated memory on success or NULL on failure; call SDL_GetError() for more information.

Remarks

Applications do not need to use this function unless they are providing their own SDL_IOStream implementation. If you just need an SDL_IOStream to read/write a common data source, you should use the built-in implementations in SDL, like SDL_IOFromFile() or SDL_IOFromMem(), etc.

This function makes a copy of iface and the caller does not need to keep it around after this call.

Version

This function is available since SDL 3.1.3.

See Also


CategoryAPI, CategoryAPIFunction, CategoryIOStream


[ 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.