rwops: Reworked RWops for SDL3.
- SDL_RWops is now an opaque struct. - SDL_AllocRW is gone. If an app is creating a custom RWops, they pass the function pointers to SDL_CreateRW(), which are stored internally. - SDL_RWclose is gone, there is only SDL_DestroyRW(), which calls the implementation's `->close` method before freeing other things. - There is only one path to create and use RWops now, so we don't have to worry about whether `->close` will call SDL_DestroyRW, or if this will risk any Properties not being released, etc. - SDL_RWFrom* still works as expected, for getting a RWops without having to supply your own implementation. Objects from these functions are also destroyed with SDL_DestroyRW. - Lots of other cleanup and SDL3ization of the library code.
This commit is contained in:
parent
495e432fb9
commit
525919b315
22 changed files with 424 additions and 470 deletions
|
@ -1913,7 +1913,7 @@ static const void *SDLTest_ScreenShotClipboardProvider(void *context, const char
|
|||
image = NULL;
|
||||
}
|
||||
}
|
||||
SDL_RWclose(file);
|
||||
SDL_DestroyRW(file);
|
||||
|
||||
if (image) {
|
||||
data->image = image;
|
||||
|
@ -1984,7 +1984,7 @@ static void SDLTest_PasteScreenShot(void)
|
|||
if (file) {
|
||||
SDL_Log("Writing clipboard image to %s", filename);
|
||||
SDL_RWwrite(file, data, size);
|
||||
SDL_RWclose(file);
|
||||
SDL_DestroyRW(file);
|
||||
}
|
||||
SDL_free(data);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue