diff --git a/docs/README-migration.md b/docs/README-migration.md index 1e1ce4b11..f611b2485 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -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. diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index 6c32e6f61..2cba0ce3f 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -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_