iostream: Note that the new name has nothing to do with C++'s iostream class.

This commit is contained in:
Ryan C. Gordon 2024-03-15 01:16:31 -04:00
parent 5a21d87e69
commit c175eb488c
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
2 changed files with 6 additions and 1 deletions

View File

@ -1157,10 +1157,12 @@ The following symbols have been renamed:
* RW_SEEK_END => SDL_IO_SEEK_END
* RW_SEEK_SET => SDL_IO_SEEK_SET
SDL_rwops.h is now named SDL_iostream.h.
SDL_rwops.h is now named SDL_iostream.h
SDL_RWops is now an opaque structure, and has been renamed to SDL_IOStream. The SDL3 APIs to create an SDL_IOStream (SDL_IOFromFile, etc) are renamed but otherwise still function as they did in SDL2. However, to make a custom SDL_IOStream with app-provided function pointers, call SDL_OpenIO and provide the function pointers through there. To call into an SDL_IOStream's functionality, use the standard APIs (SDL_ReadIO, etc), as the function pointers are internal.
SDL_IOStream is not to be confused with the unrelated standard C++ iostream class!
The RWops function pointers are now in a separate structure called SDL_IOStreamInterface, which is provided to SDL_OpenIO when creating a custom SDL_IOStream implementation. All the functions now take a `void *` userdata argument for their first parameter instead of an SDL_IOStream, since that's now an opaque structure.
SDL_RWread and SDL_RWwrite (and the read and write function pointers) have a different function signature in SDL3, in addition to being renamed.

View File

@ -24,6 +24,9 @@
*
* This file provides a general interface for SDL to read and write
* data streams. It can easily be extended to files, memory, etc.
*
* SDL_IOStream is not related to the standard C++ iostream class, other
* than both are abstract interfaces to read/write data.
*/
#ifndef SDL_iostream_h_