Added properties to various SDL objects

The following objects now have properties that can be user modified:
* SDL_AudioStream
* SDL_Gamepad
* SDL_Joystick
* SDL_RWops
* SDL_Renderer
* SDL_Sensor
* SDL_Surface
* SDL_Texture
* SDL_Window
This commit is contained in:
Sam Lantinga
2023-10-11 16:59:51 -07:00
parent 973c8b3273
commit 4368f70ff9
32 changed files with 434 additions and 292 deletions

View File

@@ -619,6 +619,7 @@ SDL_RWops *SDL_CreateRW(void)
void SDL_DestroyRW(SDL_RWops *context)
{
SDL_DestroyProperties(context->props);
SDL_free(context);
}
@@ -698,6 +699,19 @@ void *SDL_LoadFile(const char *file, size_t *datasize)
return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, SDL_TRUE);
}
SDL_PropertiesID SDL_GetRWProperties(SDL_RWops *context)
{
if (!context) {
SDL_InvalidParamError("context");
return 0;
}
if (context->props == 0) {
context->props = SDL_CreateProperties();
}
return context->props;
}
Sint64 SDL_RWsize(SDL_RWops *context)
{
if (!context) {