SDL_WriteAsyncIO

Start an async write.

This function writes size bytes from offset position in the data source to the area pointed at by ptr.

This function returns as quickly as possible; it does not wait for the write to complete. On a successful return, this work will continue in the background. If the work begins, even failure is asynchronous: a failing return value from this function only means the work couldn't start at all.

ptr must remain available until the work is done, and may be accessed by the system at any time until then. Do not allocate it on the stack, as this might take longer than the life of the calling function to complete!

An SDL_AsyncIOQueue must be specified. The newly-created task will be added to it when it completes its work.

extern (C) nothrow @nogc extern
bool
SDL_WriteAsyncIO

Parameters

asyncio SDL_AsyncIO*

a pointer to an SDL_AsyncIO structure.

ptr void*

a pointer to a buffer to write data from.

offset Uint64

the position to start writing to the data source.

size Uint64

the number of bytes to write to the data source.

queue SDL_AsyncIOQueue*

a queue to add the new SDL_AsyncIO to.

userdata void*

an app-defined pointer that will be provided with the task results.

Return Value

Type: bool

true on success or false on failure; call SDL_GetError for more information.

See Also

SDL_ReadAsyncIO SDL_CreateAsyncIOQueue

Threadsafety: It is safe to call this function from any thread.

Meta

History

Available since SDL 3.2.0.