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

@@ -29,9 +29,10 @@
#define SDL_surface_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_pixels.h>
#include <SDL3/SDL_rect.h>
#include <SDL3/SDL_blendmode.h>
#include <SDL3/SDL_pixels.h>
#include <SDL3/SDL_properties.h>
#include <SDL3/SDL_rect.h>
#include <SDL3/SDL_rwops.h>
#include <SDL3/SDL_begin_code.h>
@@ -92,7 +93,7 @@ typedef struct SDL_Surface
void *pixels; /**< Read-write */
/** Application data associated with the surface */
void *userdata; /**< Read-write */
SDL_PropertiesID props; /**< Read-write */
/** information needed for surfaces requiring locks */
int locked; /**< Read-only */
@@ -189,6 +190,19 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom
*/
extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
/**
* Get the properties associated with a surface.
*
* \param surface the SDL_Surface structure to query
* \returns a valid property ID on success or 0 on failure; call SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
/**
* Set the palette used by a surface.
*