SDL Wiki
(This is the legacy documentation for SDL2, the previous stable version; SDL3 is the current stable version.)

SDL_RWclose

Close and free an allocated SDL_RWops structure.

Header File

Defined in SDL_rwops.h

Syntax

int SDL_RWclose(SDL_RWops *context);

Function Parameters

SDL_RWops * context SDL_RWops structure to close.

Return Value

(int) Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

Remarks

SDL_RWclose() closes and cleans up the SDL_RWops stream. It releases any resources used by the stream and frees the SDL_RWops itself with SDL_FreeRW(). This returns 0 on success, or -1 if the stream failed to flush to its output (e.g. to disk).

Note that if this fails to flush the stream to disk, this function reports an error, but the SDL_RWops is still invalid once this function returns.

Prior to SDL 2.0.10, this function was a macro.

Version

This function is available since SDL 2.0.10.

See Also


CategoryAPI, CategoryAPIFunction, CategoryRWOPS


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