Renamed SDL_Get/SetProperty() to SDL_Get/SetPointerProperty()

This is consistent with the naming for the functions that affect other data types

Fixes https://github.com/libsdl-org/SDL/issues/10241
This commit is contained in:
Sam Lantinga 2024-07-12 09:39:58 -07:00
parent bf03dee866
commit 5bf6bc4d7d
55 changed files with 221 additions and 257 deletions

View File

@ -1800,32 +1800,32 @@ The information previously available in SDL_GetWindowWMInfo() is now available a
becomes:
```c
#if defined(SDL_PLATFORM_WIN32)
HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
if (hwnd) {
...
}
#elif defined(SDL_PLATFORM_MACOS)
NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL);
NSWindow *nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL);
if (nswindow) {
...
}
#elif defined(SDL_PLATFORM_LINUX)
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) {
Display *xdisplay = (Display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);
Display *xdisplay = (Display *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);
Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
if (xdisplay && xwindow) {
...
}
} else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) {
struct wl_display *display = (struct wl_display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL);
struct wl_surface *surface = (struct wl_surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL);
struct wl_display *display = (struct wl_display *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL);
struct wl_surface *surface = (struct wl_surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL);
if (display && surface) {
...
}
}
#elif defined(SDL_PLATFORM_IOS)
SDL_PropertiesID props = SDL_GetWindowProperties(window);
UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL);
UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL);
if (uiwindow) {
GLuint framebuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER, 0);
GLuint colorbuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER, 0);

View File

@ -153,7 +153,7 @@ int main(int argc, char *argv[])
}
/* Set SDL to use the existing wl_display object from Qt and initialize. */
SDL_SetProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display);
SDL_SetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display);
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS);
/* Create a basic, frameless QWindow */
@ -175,7 +175,7 @@ int main(int argc, char *argv[])
* Qt objects should not be flagged as DPI-aware or protocol violations will result.
*/
props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface);
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 640);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 480);

View File

@ -953,9 +953,6 @@ extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_Aud
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream);

View File

@ -367,9 +367,6 @@ extern SDL_DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camer
* \threadsafety It is safe to call this function from any thread.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera);

View File

@ -725,9 +725,6 @@ extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int playe
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *gamepad);

View File

@ -395,9 +395,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_CloseIO(SDL_IOStream *context);
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetIOProperties(SDL_IOStream *context);

View File

@ -654,9 +654,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick *
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick *joystick);

View File

@ -32,7 +32,7 @@
* Properties can be added to and retrieved from a property set through the
* following functions:
*
* - SDL_SetProperty and SDL_GetProperty operate on `void*` pointer types.
* - SDL_SetPointerProperty and SDL_GetPointerProperty operate on `void*` pointer types.
* - SDL_SetStringProperty and SDL_GetStringProperty operate on string types.
* - SDL_SetNumberProperty and SDL_GetNumberProperty operate on signed 64-bit
* integer types.
@ -86,9 +86,6 @@ typedef enum SDL_PropertyType
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void);
@ -113,7 +110,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void);
*
* Copy all the properties from one set of properties to another, with the
* exception of properties requiring cleanup (set using
* SDL_SetPropertyWithCleanup()), which will not be copied. Any property that
* SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any property that
* already exists on `dst` will be overwritten.
*
* \param src the properties to copy.
@ -173,7 +170,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
* This callback is set per-property. Different properties in the same set can
* have different cleanup callbacks.
*
* This callback will be called _during_ SDL_SetPropertyWithCleanup if the
* This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if the
* function fails for any reason.
*
* \param userdata an app-defined pointer passed to the callback.
@ -184,7 +181,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
*
* \since This datatype is available since SDL 3.0.0.
*
* \sa SDL_SetPropertyWithCleanup
* \sa SDL_SetPointerPropertyWithCleanup
*/
typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value);
@ -213,11 +210,11 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value)
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
* \sa SDL_GetPointerProperty
* \sa SDL_SetPointerProperty
* \sa SDL_CleanupPropertyCallback
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata);
/**
* Set a property on a set of properties.
@ -232,15 +229,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID prop
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_GetPointerProperty
* \sa SDL_HasProperty
* \sa SDL_SetBooleanProperty
* \sa SDL_SetFloatProperty
* \sa SDL_SetNumberProperty
* \sa SDL_SetPropertyWithCleanup
* \sa SDL_SetPointerPropertyWithCleanup
* \sa SDL_SetStringProperty
*/
extern SDL_DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value);
extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value);
/**
* Set a string property on a set of properties.
@ -360,7 +357,7 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI
*
* \threadsafety It is safe to call this function from any thread, although
* the data returned is not protected and could potentially be
* freed if you call SDL_SetProperty() or SDL_ClearProperty() on
* freed if you call SDL_SetPointerProperty() or SDL_ClearProperty() on
* these properties from another thread. If you need to avoid
* this, use SDL_LockProperties() and SDL_UnlockProperties().
*
@ -372,9 +369,9 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI
* \sa SDL_GetPropertyType
* \sa SDL_GetStringProperty
* \sa SDL_HasProperty
* \sa SDL_SetProperty
* \sa SDL_SetPointerProperty
*/
extern SDL_DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value);
extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value);
/**
* Get a string property on a set of properties.

View File

@ -413,9 +413,6 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetRendererName(SDL_Renderer *render
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer *renderer);
@ -758,9 +755,6 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Ren
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Texture *texture);

View File

@ -217,9 +217,6 @@ extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor *sensor);

View File

@ -211,9 +211,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);

View File

@ -429,9 +429,6 @@ extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_SetProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID displayID);
@ -1225,9 +1222,6 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetProperty
* \sa SDL_GetNumberProperty
*/
extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *window);

View File

@ -336,7 +336,7 @@ static int SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_
return result;
}
int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata)
int SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata)
{
SDL_Property *property;
@ -362,7 +362,7 @@ int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *v
return SDL_PrivateSetProperty(props, name, property);
}
int SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value)
int SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value)
{
SDL_Property *property;
@ -386,7 +386,7 @@ static void SDLCALL CleanupFreeableProperty(void *userdata, void *value)
int SDL_SetFreeableProperty(SDL_PropertiesID props, const char *name, void *value)
{
return SDL_SetPropertyWithCleanup(props, name, value, CleanupFreeableProperty, NULL);
return SDL_SetPointerPropertyWithCleanup(props, name, value, CleanupFreeableProperty, NULL);
}
static void SDLCALL CleanupSurface(void *userdata, void *value)
@ -398,7 +398,7 @@ static void SDLCALL CleanupSurface(void *userdata, void *value)
int SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surface *surface)
{
return SDL_SetPropertyWithCleanup(props, name, surface, CleanupSurface, NULL);
return SDL_SetPointerPropertyWithCleanup(props, name, surface, CleanupSurface, NULL);
}
int SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value)
@ -492,7 +492,7 @@ SDL_PropertyType SDL_GetPropertyType(SDL_PropertiesID props, const char *name)
return type;
}
void *SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value)
void *SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value)
{
SDL_Properties *properties = NULL;
void *value = default_value;
@ -775,7 +775,7 @@ static void SDLCALL SDL_DumpPropertiesCallback(void *userdata, SDL_PropertiesID
{
switch (SDL_GetPropertyType(props, name)) {
case SDL_PROPERTY_TYPE_POINTER:
SDL_Log("%s: %p\n", name, SDL_GetProperty(props, name, NULL));
SDL_Log("%s: %p\n", name, SDL_GetPointerProperty(props, name, NULL));
break;
case SDL_PROPERTY_TYPE_STRING:
SDL_Log("%s: \"%s\"\n", name, SDL_GetStringProperty(props, name, ""));

View File

@ -468,7 +468,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f
} else {
frame->pixels = pixels;
frame->pitch = (int) pitch;
if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) {
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) {
retval = -1;
}
}
@ -480,7 +480,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f
} else {
frame->pixels = pixels;
frame->pitch = (int) pitch;
if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) {
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) {
retval = -1;
}
}
@ -497,7 +497,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f
}
frame->pixels = pixels;
frame->pitch = (int) pitch;
if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) {
if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) {
retval = -1;
}
}

View File

@ -422,7 +422,7 @@ void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window)
#ifdef SDL_VIDEO_DRIVER_X11
{
SDL_PropertiesID props = SDL_GetWindowProperties(window);
Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);
Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);
int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0);
Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
Window unused;

View File

@ -703,7 +703,7 @@ void SDL_IBus_UpdateTextInputArea(SDL_Window *window)
#ifdef SDL_VIDEO_DRIVER_X11
{
SDL_PropertiesID props = SDL_GetWindowProperties(window);
Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);
Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL);
int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0);
Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0);
Window unused;

View File

@ -130,7 +130,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback
NSWindow *w = NULL;
if (window) {
w = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL);
w = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL);
}
if (w) {

View File

@ -101,7 +101,7 @@ void windows_ShowFileDialog(void *ptr)
HWND window = NULL;
if (parent) {
window = (HWND) SDL_GetProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
window = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
}
wchar_t *filebuffer; /* lpstrFile */
@ -391,7 +391,7 @@ void windows_ShowFolderDialog(void* ptr)
HWND parent = NULL;
if (window) {
parent = (HWND) SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
parent = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
}
wchar_t buffer[MAX_PATH];

View File

@ -368,12 +368,12 @@ SDL3_0.0.0 {
SDL_GetPixelFormatForMasks;
SDL_GetPixelFormatName;
SDL_GetPlatform;
SDL_GetPointerProperty;
SDL_GetPowerInfo;
SDL_GetPrefPath;
SDL_GetPreferredLocales;
SDL_GetPrimaryDisplay;
SDL_GetPrimarySelectionText;
SDL_GetProperty;
SDL_GetPropertyType;
SDL_GetRGB;
SDL_GetRGBA;
@ -730,9 +730,9 @@ SDL3_0.0.0 {
SDL_SetModState;
SDL_SetNumberProperty;
SDL_SetPaletteColors;
SDL_SetPointerProperty;
SDL_SetPointerPropertyWithCleanup;
SDL_SetPrimarySelectionText;
SDL_SetProperty;
SDL_SetPropertyWithCleanup;
SDL_SetRelativeMouseMode;
SDL_SetRenderClipRect;
SDL_SetRenderColorScale;

View File

@ -393,12 +393,12 @@
#define SDL_GetPixelFormatForMasks SDL_GetPixelFormatForMasks_REAL
#define SDL_GetPixelFormatName SDL_GetPixelFormatName_REAL
#define SDL_GetPlatform SDL_GetPlatform_REAL
#define SDL_GetPointerProperty SDL_GetPointerProperty_REAL
#define SDL_GetPowerInfo SDL_GetPowerInfo_REAL
#define SDL_GetPrefPath SDL_GetPrefPath_REAL
#define SDL_GetPreferredLocales SDL_GetPreferredLocales_REAL
#define SDL_GetPrimaryDisplay SDL_GetPrimaryDisplay_REAL
#define SDL_GetPrimarySelectionText SDL_GetPrimarySelectionText_REAL
#define SDL_GetProperty SDL_GetProperty_REAL
#define SDL_GetPropertyType SDL_GetPropertyType_REAL
#define SDL_GetRGB SDL_GetRGB_REAL
#define SDL_GetRGBA SDL_GetRGBA_REAL
@ -755,9 +755,9 @@
#define SDL_SetModState SDL_SetModState_REAL
#define SDL_SetNumberProperty SDL_SetNumberProperty_REAL
#define SDL_SetPaletteColors SDL_SetPaletteColors_REAL
#define SDL_SetPointerProperty SDL_SetPointerProperty_REAL
#define SDL_SetPointerPropertyWithCleanup SDL_SetPointerPropertyWithCleanup_REAL
#define SDL_SetPrimarySelectionText SDL_SetPrimarySelectionText_REAL
#define SDL_SetProperty SDL_SetProperty_REAL
#define SDL_SetPropertyWithCleanup SDL_SetPropertyWithCleanup_REAL
#define SDL_SetRelativeMouseMode SDL_SetRelativeMouseMode_REAL
#define SDL_SetRenderClipRect SDL_SetRenderClipRect_REAL
#define SDL_SetRenderColorScale SDL_SetRenderColorScale_REAL

View File

@ -413,12 +413,12 @@ SDL_DYNAPI_PROC(const SDL_PixelFormatDetails*,SDL_GetPixelFormatDetails,(SDL_Pix
SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetPixelFormatForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormat a),(a),return)
SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return)
SDL_DYNAPI_PROC(void*,SDL_GetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return)
SDL_DYNAPI_PROC(char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return)
SDL_DYNAPI_PROC(SDL_Locale*,SDL_GetPreferredLocales,(void),(),return)
SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return)
SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return)
SDL_DYNAPI_PROC(void*,SDL_GetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),)
SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),)
@ -765,9 +765,9 @@ SDL_DYNAPI_PROC(int,SDL_SetMemoryFunctions,(SDL_malloc_func a, SDL_calloc_func b
SDL_DYNAPI_PROC(void,SDL_SetModState,(SDL_Keymod a),(a),)
SDL_DYNAPI_PROC(int,SDL_SetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_SetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetPointerPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_SetPrimarySelectionText,(const char *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_SetRelativeMouseMode,(SDL_bool a),(a),return)
SDL_DYNAPI_PROC(int,SDL_SetRenderClipRect,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetRenderColorScale,(SDL_Renderer *a, float b),(a,b),return)

View File

@ -431,7 +431,7 @@ static SDL_IOStream *SDL_IOFromFP(FILE *fp, SDL_bool autoclose)
} else {
const SDL_PropertiesID props = SDL_GetIOProperties(iostr);
if (props) {
SDL_SetProperty(props, SDL_PROP_IOSTREAM_STDIO_FILE_POINTER, fp);
SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_STDIO_FILE_POINTER, fp);
}
}
@ -615,7 +615,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode)
} else {
const SDL_PropertiesID props = SDL_GetIOProperties(iostr);
if (props) {
SDL_SetProperty(props, SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER, iodata);
SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER, iodata);
}
}
@ -644,7 +644,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode)
} else {
const SDL_PropertiesID props = SDL_GetIOProperties(iostr);
if (props) {
SDL_SetProperty(props, SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER, iodata->h);
SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER, iodata->h);
}
}
@ -793,7 +793,7 @@ static int dynamic_mem_realloc(IOStreamDynamicMemData *iodata, size_t size)
iodata->data.here = base + here_offset;
iodata->data.stop = base + stop_offset;
iodata->end = base + length;
return SDL_SetProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, base);
return SDL_SetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, base);
}
static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status)
@ -813,7 +813,7 @@ static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t
static int SDLCALL dynamic_mem_close(void *userdata)
{
const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata;
void *mem = SDL_GetProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
if (mem) {
SDL_free(mem);
}

View File

@ -151,7 +151,7 @@ int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormat format
texture_formats[renderer->num_texture_formats++] = format;
texture_formats[renderer->num_texture_formats] = SDL_PIXELFORMAT_UNKNOWN;
renderer->texture_formats = texture_formats;
SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, texture_formats);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, texture_formats);
return 0;
}
@ -942,8 +942,8 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind
SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props)
{
#ifndef SDL_RENDER_DISABLED
SDL_Window *window = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL);
SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL);
SDL_Window *window = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL);
SDL_Surface *surface = (SDL_Surface *)SDL_GetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL);
const char *name = SDL_GetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, NULL);
const int n = SDL_GetNumRenderDrivers();
const char *hint;
@ -1083,16 +1083,16 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props)
new_props = SDL_GetRendererProperties(renderer);
SDL_SetStringProperty(new_props, SDL_PROP_RENDERER_NAME_STRING, renderer->name);
if (window) {
SDL_SetProperty(new_props, SDL_PROP_RENDERER_WINDOW_POINTER, window);
SDL_SetPointerProperty(new_props, SDL_PROP_RENDERER_WINDOW_POINTER, window);
}
if (surface) {
SDL_SetProperty(new_props, SDL_PROP_RENDERER_SURFACE_POINTER, surface);
SDL_SetPointerProperty(new_props, SDL_PROP_RENDERER_SURFACE_POINTER, surface);
}
SDL_SetNumberProperty(new_props, SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER, renderer->output_colorspace);
UpdateHDRProperties(renderer);
if (window) {
SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, renderer);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, renderer);
}
SDL_SetRenderViewport(renderer, NULL);
@ -1145,7 +1145,7 @@ SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name)
{
SDL_Renderer *renderer;
SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, name);
renderer = SDL_CreateRendererWithProperties(props);
SDL_DestroyProperties(props);
@ -1163,7 +1163,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
}
SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface);
renderer = SDL_CreateRendererWithProperties(props);
SDL_DestroyProperties(props);
return renderer;
@ -1175,7 +1175,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
SDL_Renderer *SDL_GetRenderer(SDL_Window *window)
{
return (SDL_Renderer *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, NULL);
return (SDL_Renderer *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, NULL);
}
SDL_Window *SDL_GetRenderWindow(SDL_Renderer *renderer)
@ -1401,7 +1401,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
return NULL;
}
SDL_SetProperty(SDL_GetTextureProperties(texture->native), SDL_PROP_TEXTURE_PARENT_POINTER, texture);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture->native), SDL_PROP_TEXTURE_PARENT_POINTER, texture);
/* Swap textures to have texture before texture->native in the list */
texture->native->next = texture->next;
@ -2416,7 +2416,7 @@ SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer)
if (renderer->target == renderer->logical_target) {
return NULL;
} else {
return (SDL_Texture *)SDL_GetProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target);
return (SDL_Texture *)SDL_GetPointerProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target);
}
}
@ -4401,7 +4401,7 @@ SDL_Surface *SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect)
static void SDL_RenderApplyWindowShape(SDL_Renderer *renderer)
{
SDL_Surface *shape = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL);
SDL_Surface *shape = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL);
if (shape != renderer->shape_surface) {
if (renderer->shape_texture) {
SDL_DestroyTexture(renderer->shape_texture);

View File

@ -1604,7 +1604,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie
SDL_DisplayID displayID;
const SDL_DisplayMode *fullscreen_mode = NULL;
hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
if (!hwnd) {
return SDL_SetError("Couldn't get window handle");
}
@ -1752,7 +1752,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie
}
#endif
SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D9_DEVICE_POINTER, data->device);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D9_DEVICE_POINTER, data->device);
return 0;
}

View File

@ -800,7 +800,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer)
ID3D11DeviceContext_VSSetShader(data->d3dContext, data->vertexShader, NULL, 0);
ID3D11DeviceContext_VSSetConstantBuffers(data->d3dContext, 0, 1, &data->vertexShaderConstants);
SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice);
done:
SAFE_RELEASE(d3dDevice);
@ -975,7 +975,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
#endif
} else {
#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK)
HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
if (!hwnd) {
SDL_SetError("Couldn't get window handle");
result = E_FAIL;
@ -1031,7 +1031,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
}
}
SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER, data->swapChain);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER, data->swapChain);
done:
SAFE_RELEASE(swapChain3);
@ -1251,7 +1251,7 @@ static SDL_bool D3D11_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode bl
static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D11Texture2D **texture)
{
IUnknown *unknown = SDL_GetProperty(props, name, NULL);
IUnknown *unknown = SDL_GetPointerProperty(props, name, NULL);
if (unknown) {
HRESULT result = IUnknown_QueryInterface(unknown, &SDL_IID_ID3D11Texture2D, (void **)texture);
if (FAILED(result)) {
@ -1334,7 +1334,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result);
}
}
SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, textureData->mainTexture);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, textureData->mainTexture);
#if SDL_HAVE_YUV
if (texture->format == SDL_PIXELFORMAT_YV12 ||
texture->format == SDL_PIXELFORMAT_IYUV) {
@ -1355,7 +1355,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result);
}
}
SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU);
if (GetTextureProperty(create_props, "d3d11.texture_v", &textureData->mainTextureV) < 0) {
return -1;
@ -1369,7 +1369,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result);
}
}
SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER, textureData->mainTextureV);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER, textureData->mainTextureV);
textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8);
if (!textureData->YCbCr_matrix) {
@ -2783,7 +2783,7 @@ static int D3D11_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_
{
D3D11_RenderData *data;
HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
if (!hwnd) {
return SDL_SetError("Couldn't get window handle");
}

View File

@ -44,7 +44,7 @@ using namespace Windows::Graphics::Display;
extern "C" void *
D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer)
{
IInspectable *window = (IInspectable *)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL);
IInspectable *window = (IInspectable *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL);
ABI::Windows::UI::Core::ICoreWindow *coreWindow = NULL;
if (!window || FAILED(window->QueryInterface(&coreWindow))) {
return NULL;

View File

@ -446,8 +446,8 @@ static void D3D12_ReleaseAll(SDL_Renderer *renderer)
SDL_Texture *texture = NULL;
SDL_PropertiesID props = SDL_GetRendererProperties(renderer);
SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, NULL);
SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, NULL);
/* Release all textures */
for (texture = renderer->textures; texture; texture = texture->next) {
@ -1192,8 +1192,8 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer)
data->srvPoolHead = &data->srvPoolNodes[0];
SDL_PropertiesID props = SDL_GetRendererProperties(renderer);
SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice);
SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue);
done:
SAFE_RELEASE(d3dDevice);
@ -1310,7 +1310,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT | /* To support SetMaximumFrameLatency */
DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; /* To support presenting with allow tearing on */
HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
if (!hwnd) {
SDL_SetError("Couldn't get window handle");
result = E_FAIL;
@ -1376,7 +1376,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h)
result = DXGI_ERROR_UNSUPPORTED;
}
SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER, data->swapChain);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER, data->swapChain);
done:
SAFE_RELEASE(swapChain);
@ -1600,7 +1600,7 @@ static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index)
static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D12Resource **texture)
{
IUnknown *unknown = (IUnknown*)SDL_GetProperty(props, name, NULL);
IUnknown *unknown = (IUnknown*)SDL_GetPointerProperty(props, name, NULL);
if (unknown) {
HRESULT result = D3D_CALL(unknown, QueryInterface, D3D_GUID(SDL_IID_ID3D12Resource), (void **)texture);
if (FAILED(result)) {
@ -1685,7 +1685,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
}
}
textureData->mainResourceState = D3D12_RESOURCE_STATE_COPY_DEST;
SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER, textureData->mainTexture);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER, textureData->mainTexture);
#if SDL_HAVE_YUV
if (texture->format == SDL_PIXELFORMAT_YV12 ||
texture->format == SDL_PIXELFORMAT_IYUV) {
@ -1711,7 +1711,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
}
}
textureData->mainResourceStateU = D3D12_RESOURCE_STATE_COPY_DEST;
SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU);
if (GetTextureProperty(create_props, "d3d12.texture_v", &textureData->mainTextureV) < 0) {
return -1;
@ -1730,7 +1730,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
}
}
textureData->mainResourceStateV = D3D12_RESOURCE_STATE_COPY_DEST;
SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER, textureData->mainTextureV);
SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER, textureData->mainTextureV);
textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8);
if (!textureData->YCbCr_matrix) {
@ -3232,7 +3232,7 @@ int D3D12_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propert
{
D3D12_RenderData *data;
HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
if (!hwnd) {
return SDL_SetError("Couldn't get window handle");
}

View File

@ -632,7 +632,7 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL
CVPixelBufferRef pixelbuffer = nil;
IOSurfaceRef surface = nil;
pixelbuffer = SDL_GetProperty(create_props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, nil);
pixelbuffer = SDL_GetPointerProperty(create_props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, nil);
if (pixelbuffer) {
surface = CVPixelBufferGetIOSurface(pixelbuffer);
if (!surface) {
@ -1861,7 +1861,7 @@ static int METAL_SetVSync(SDL_Renderer *renderer, const int vsync)
static SDL_MetalView GetWindowView(SDL_Window *window)
{
#ifdef SDL_VIDEO_DRIVER_COCOA
NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL);
NSWindow *nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL);
NSInteger tag = (NSInteger)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, 0);
if (nswindow && tag) {
NSView *view = nswindow.contentView;
@ -1875,7 +1875,7 @@ static SDL_MetalView GetWindowView(SDL_Window *window)
#endif
#ifdef SDL_VIDEO_DRIVER_UIKIT
UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL);
UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL);
NSInteger tag = (NSInteger)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER, 0);
if (uiwindow && tag) {
UIView *view = uiwindow.rootViewController.view;

View File

@ -1713,7 +1713,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
rendererData->supportsKHRGetPhysicalDeviceProperties2 = VULKAN_InstanceExtensionFound(rendererData, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
/* Create VkInstance */
rendererData->instance = (VkInstance)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL);
rendererData->instance = (VkInstance)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL);
if (rendererData->instance) {
rendererData->instance_external = SDL_TRUE;
} else {
@ -1769,7 +1769,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
}
/* Choose Vulkan physical device */
rendererData->physicalDevice = (VkPhysicalDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, NULL);
rendererData->physicalDevice = (VkPhysicalDevice)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, NULL);
if (rendererData->physicalDevice) {
vkGetPhysicalDeviceMemoryProperties(rendererData->physicalDevice, &rendererData->physicalDeviceMemoryProperties);
vkGetPhysicalDeviceFeatures(rendererData->physicalDevice, &rendererData->physicalDeviceFeatures);
@ -1793,7 +1793,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
}
/* Create Vulkan device */
rendererData->device = (VkDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL);
rendererData->device = (VkDevice)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL);
if (rendererData->device) {
rendererData->device_external = SDL_TRUE;
} else {
@ -1936,10 +1936,10 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
}
SDL_PropertiesID props = SDL_GetRendererProperties(renderer);
SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER, rendererData->instance);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER, rendererData->instance);
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_SURFACE_NUMBER, (Sint64)rendererData->surface);
SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER, rendererData->physicalDevice);
SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER, rendererData->device);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER, rendererData->physicalDevice);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER, rendererData->device);
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, rendererData->graphicsQueueFamilyIndex);
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, rendererData->presentQueueFamilyIndex);

View File

@ -1045,7 +1045,7 @@ static void SDLTest_PrintRenderer(SDL_Renderer *renderer)
SDL_Log(" Renderer %s:\n", name);
SDL_Log(" VSync: %d\n", (int)SDL_GetNumberProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_VSYNC_NUMBER, 0));
texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL);
texture_formats = (const SDL_PixelFormat *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL);
if (texture_formats) {
(void)SDL_snprintf(text, sizeof(text), " Texture formats: ");
for (i = 0; texture_formats[i]; ++i) {

View File

@ -361,10 +361,10 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props,
}
#endif
SDL_ThreadFunction fn = (SDL_ThreadFunction) SDL_GetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, NULL);
SDL_ThreadFunction fn = (SDL_ThreadFunction) SDL_GetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, NULL);
const char *name = SDL_GetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, NULL);
const size_t stacksize = (size_t) SDL_GetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, 0);
void *userdata = SDL_GetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, NULL);
void *userdata = SDL_GetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, NULL);
if (!fn) {
SDL_SetError("Thread entry function is NULL");
@ -411,9 +411,9 @@ SDL_Thread *SDL_CreateThreadRuntime(SDL_ThreadFunction fn,
SDL_FunctionPointer pfnEndThread)
{
const SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn);
SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn);
SDL_SetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, name);
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata);
SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata);
SDL_Thread *thread = SDL_CreateThreadWithPropertiesRuntime(props, pfnBeginThread, pfnEndThread);
SDL_DestroyProperties(props);
return thread;
@ -423,9 +423,9 @@ SDL_Thread *SDL_CreateThreadRuntime(SDL_ThreadFunction fn,
SDL_Thread *SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, size_t stacksize, void *userdata)
{
const SDL_PropertiesID props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn);
SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn);
SDL_SetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, name);
SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata);
SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata);
SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, (Sint64) stacksize);
SDL_Thread *thread = SDL_CreateThreadWithProperties(props);
SDL_DestroyProperties(props);

View File

@ -287,7 +287,7 @@ static void SDLCALL SDL_CleanupWindowTextureData(void *userdata, void *value)
static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch)
{
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
const SDL_bool transparent = (window->flags & SDL_WINDOW_TRANSPARENT) ? SDL_TRUE : SDL_FALSE;
int i;
int w, h;
@ -347,7 +347,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S
SDL_DestroyRenderer(renderer);
return -1;
}
if (SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL) < 0) {
if (SDL_SetPointerPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL) < 0) {
SDL_DestroyRenderer(renderer);
return -1;
}
@ -355,7 +355,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S
data->renderer = renderer;
}
texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL);
texture_formats = (const SDL_PixelFormat *)SDL_GetPointerProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL);
if (!texture_formats) {
return -1;
}
@ -416,7 +416,7 @@ int SDL_SetWindowTextureVSync(SDL_VideoDevice *_this, SDL_Window *window, int vs
{
SDL_WindowTextureData *data;
data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
if (!data) {
return -1;
}
@ -430,7 +430,7 @@ static int SDL_GetWindowTextureVSync(SDL_VideoDevice *_this, SDL_Window *window,
{
SDL_WindowTextureData *data;
data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
if (!data) {
return -1;
}
@ -449,7 +449,7 @@ static int SDL_UpdateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, c
SDL_GetWindowSizeInPixels(window, &w, &h);
data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
if (!data || !data->texture) {
return SDL_SetError("No window texture data");
}
@ -2155,7 +2155,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
int y = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, SDL_WINDOWPOS_UNDEFINED);
int w = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 0);
int h = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 0);
SDL_Window *parent = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, NULL);
SDL_Window *parent = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, NULL);
SDL_WindowFlags flags = SDL_GetWindowFlagProperties(props);
SDL_WindowFlags type_flags, graphics_flags;
SDL_bool undefined_x = SDL_FALSE;
@ -2400,7 +2400,7 @@ SDL_Window *SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y
return NULL;
}
SDL_SetProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, parent);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, parent);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, offset_x);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, offset_y);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w);
@ -3758,7 +3758,7 @@ void SDL_OnWindowResized(SDL_Window *window)
SDL_CheckWindowPixelSizeChanged(window);
if ((window->flags & SDL_WINDOW_TRANSPARENT) && _this->UpdateWindowShape) {
SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(window->props, SDL_PROP_WINDOW_SHAPE_POINTER, NULL);
SDL_Surface *surface = (SDL_Surface *)SDL_GetPointerProperty(window->props, SDL_PROP_WINDOW_SHAPE_POINTER, NULL);
if (surface) {
_this->UpdateWindowShape(_this, window, surface);
}

View File

@ -72,7 +72,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
retval = SDL_SetError("Could not fetch native window");
goto endfunction;
}
SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER, data->native_window);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER, data->native_window);
/* Do not create EGLSurface for Vulkan window since it will then make the window
incompatible with vkCreateAndroidSurfaceKHR */
@ -87,7 +87,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
goto endfunction;
}
}
SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface);
#endif
window->driverdata = data;

View File

@ -846,7 +846,7 @@ static NSCursor *Cocoa_GetDesiredCursor(void)
- (void)updateIgnoreMouseState:(NSEvent *)theEvent
{
SDL_Window *window = _data.window;
SDL_Surface *shape = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL);
SDL_Surface *shape = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL);
BOOL ignoresMouseEvents = NO;
if (shape) {
@ -2054,7 +2054,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow
}
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_SetProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, (__bridge void *)data.nswindow);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, (__bridge void *)data.nswindow);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG);
/* All done! */
@ -2067,7 +2067,7 @@ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie
{
@autoreleasepool {
SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata;
const void *data = SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL);
const void *data = SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL);
NSWindow *nswindow = nil;
NSView *nsview = nil;
@ -2080,8 +2080,8 @@ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie
SDL_assert(false);
}
} else {
nswindow = (__bridge NSWindow *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER, NULL);
nsview = (__bridge NSView *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER, NULL);
nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER, NULL);
nsview = (__bridge NSView *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER, NULL);
}
if (nswindow && !nsview) {
nsview = [nswindow contentView];

View File

@ -55,7 +55,7 @@ int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window
static int frame_number;
SDL_Surface *surface;
surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), DUMMY_SURFACE, NULL);
surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), DUMMY_SURFACE, NULL);
if (!surface) {
return SDL_SetError("Couldn't find dummy surface for window");
}

View File

@ -1578,7 +1578,7 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER, viddata->devindex);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd);
SDL_SetProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev);
if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */

View File

@ -73,7 +73,7 @@ int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window,
void *framebuffer;
u32 bufsize;
surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), N3DS_SURFACE, NULL);
surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), N3DS_SURFACE, NULL);
if (!surface) {
return SDL_SetError("%s: Unable to get the window surface.", __func__);
}

View File

@ -56,7 +56,7 @@ int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *wi
static int frame_number;
SDL_Surface *surface;
surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), OFFSCREEN_SURFACE, NULL);
surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), OFFSCREEN_SURFACE, NULL);
if (!surface) {
return SDL_SetError("Couldn't find offscreen surface for window");
}

View File

@ -146,7 +146,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow
[view setSDLWindow:window];
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_SetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, (__bridge void *)data.uiwindow);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, (__bridge void *)data.uiwindow);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG);
return 0;

View File

@ -256,7 +256,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
window->driverdata = data;
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display);
#ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK
data->native_window = vdkCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h);
@ -266,7 +266,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
if (!data->native_window) {
return SDL_SetError("VIVANTE: Can't create native window");
}
SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER, data->native_window);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER, data->native_window);
#ifdef SDL_VIDEO_OPENGL_EGL
if (window->flags & SDL_WINDOW_OPENGL) {
@ -277,7 +277,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
} else {
data->egl_surface = EGL_NO_SURFACE;
}
SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER, data->egl_surface);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER, data->egl_surface);
#endif
/* Window has been successfully created */

View File

@ -377,7 +377,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void)
SDL_VideoDevice *device;
SDL_VideoData *data;
struct SDL_WaylandInput *input;
struct wl_display *display = SDL_GetProperty(SDL_GetGlobalProperties(),
struct wl_display *display = SDL_GetPointerProperty(SDL_GetGlobalProperties(),
SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL);
SDL_bool display_is_external = !!display;
@ -441,7 +441,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void)
}
if (!display_is_external) {
SDL_SetProperty(SDL_GetGlobalProperties(),
SDL_SetPointerProperty(SDL_GetGlobalProperties(),
SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display);
}

View File

@ -1709,8 +1709,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
zxdg_exported_v2_add_listener(data->exported, &exported_v2_listener, data);
}
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame));
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame));
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame));
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame));
}
} else
#endif
@ -1718,7 +1718,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
data->shell_surface.xdg.surface = xdg_wm_base_get_xdg_surface(c->shell.xdg, data->surface);
xdg_surface_set_user_data(data->shell_surface.xdg.surface, data);
xdg_surface_add_listener(data->shell_surface.xdg.surface, &shell_surface_listener_xdg, data);
SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface);
if (data->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) {
SDL_Window *parent = window->parent;
@ -1777,8 +1777,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
}
}
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, data->shell_surface.xdg.roleobj.popup.popup);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, data->shell_surface.xdg.roleobj.popup.positioner);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, data->shell_surface.xdg.roleobj.popup.popup);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, data->shell_surface.xdg.roleobj.popup.positioner);
} else {
data->shell_surface.xdg.roleobj.toplevel = xdg_surface_get_toplevel(data->shell_surface.xdg.surface);
xdg_toplevel_set_app_id(data->shell_surface.xdg.roleobj.toplevel, data->app_id);
@ -1789,7 +1789,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
zxdg_exported_v2_add_listener(data->exported, &exported_v2_listener, data);
}
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, data->shell_surface.xdg.roleobj.toplevel);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, data->shell_surface.xdg.roleobj.toplevel);
}
}
@ -1929,8 +1929,8 @@ static void Wayland_ReleasePopup(SDL_VideoDevice *_this, SDL_Window *popup)
popupdata->shell_surface.xdg.roleobj.popup.positioner = NULL;
SDL_PropertiesID props = SDL_GetWindowProperties(popup);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, NULL);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, NULL);
}
void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
@ -1983,8 +1983,8 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
libdecor_frame_unref(wind->shell_surface.libdecor.frame);
wind->shell_surface.libdecor.frame = NULL;
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL);
}
} else
#endif
@ -1993,12 +1993,12 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
} else if (wind->shell_surface.xdg.roleobj.toplevel) {
xdg_toplevel_destroy(wind->shell_surface.xdg.roleobj.toplevel);
wind->shell_surface.xdg.roleobj.toplevel = NULL;
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL);
}
if (wind->shell_surface.xdg.surface) {
xdg_surface_destroy(wind->shell_surface.xdg.surface);
wind->shell_surface.xdg.surface = NULL;
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL);
}
wind->show_hide_sync_required = SDL_TRUE;
@ -2315,8 +2315,8 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
{
SDL_WindowData *data;
SDL_VideoData *c = _this->driverdata;
struct wl_surface *external_surface = (struct wl_surface *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER,
(struct wl_surface *)SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL));
struct wl_surface *external_surface = (struct wl_surface *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER,
(struct wl_surface *)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL));
const SDL_bool custom_surface_role = (external_surface != NULL) || SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN, SDL_FALSE);
const SDL_bool create_egl_window = !!(window->flags & SDL_WINDOW_OPENGL) ||
SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN, SDL_FALSE);
@ -2485,9 +2485,9 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
}
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface);
SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER, data->egl_window);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER, data->egl_window);
data->hit_test_result = SDL_HITTEST_NORMAL;

View File

@ -572,9 +572,9 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd
#endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/
SDL_PropertiesID props = SDL_GetWindowProperties(window);
SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, data->hwnd);
SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_HDC_POINTER, data->hdc);
SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER, data->hinstance);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, data->hwnd);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HDC_POINTER, data->hdc);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER, data->hinstance);
/* All done! */
return 0;
@ -673,7 +673,7 @@ static void WIN_SetKeyboardFocus(SDL_Window *window)
int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
{
HWND hwnd = (HWND)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER, SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL));
HWND hwnd = (HWND)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER, SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL));
HWND parent = NULL;
if (hwnd) {
window->flags |= SDL_WINDOW_EXTERNAL;
@ -755,7 +755,7 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI
}
}
HWND share_hwnd = (HWND)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER, NULL);
HWND share_hwnd = (HWND)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER, NULL);
if (share_hwnd) {
HDC hdc = GetDC(share_hwnd);
int pixel_format = GetPixelFormat(hdc);

View File

@ -610,7 +610,7 @@ int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie
data->appView = ApplicationView::GetForCurrentView();
#endif
}
SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast<IInspectable *>(data->coreWindow.Get()));
SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast<IInspectable *>(data->coreWindow.Get()));
/* Make note of the requested window flags, before they start getting changed. */
const Uint32 requestedFlags = window->flags;

View File

@ -412,7 +412,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, Window w)
SDL_PropertiesID props = SDL_GetWindowProperties(window);
int screen = (displaydata ? displaydata->screen : 0);
SDL_SetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, data->videodata->display);
SDL_SetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, data->videodata->display);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, screen);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, data->xwindow);
@ -454,7 +454,7 @@ static void SetWindowBordered(Display *display, int screen, Window window, SDL_b
int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props)
{
Window w = (Window)SDL_GetNumberProperty(create_props, SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER,
(Window)SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL));
(Window)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL));
if (w) {
window->flags |= SDL_WINDOW_EXTERNAL;

View File

@ -343,14 +343,14 @@ static int iostrm_testDynamicMem(void *arg)
testGenericIOStreamValidations(rw, SDL_TRUE);
/* Get the dynamic memory and verify it */
mem = (char *)SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
SDLTest_AssertPass("Call to SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded");
mem = (char *)SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
SDLTest_AssertPass("Call to SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded");
SDLTest_AssertCheck(mem != NULL, "Verify memory value is not NULL");
mem[SDL_GetIOSize(rw)] = '\0';
SDLTest_AssertCheck(SDL_strcmp(mem, IOStreamHelloWorldTestString) == 0, "Verify memory value is correct");
/* Take the memory and free it ourselves */
SDL_SetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
SDL_free(mem);
/* Close */

View File

@ -43,12 +43,12 @@ static int properties_testBasic(void *arg)
for (i = 0; i < 10; ++i) {
SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i);
SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i);
result = SDL_SetProperty(props, key, expected_value);
SDLTest_AssertPass("Call to SDL_SetProperty()");
result = SDL_SetPointerProperty(props, key, expected_value);
SDLTest_AssertPass("Call to SDL_SetPointerProperty()");
SDLTest_AssertCheck(result == 0,
"Verify property value was set, got: %d", result);
value = SDL_GetProperty(props, key, NULL);
SDLTest_AssertPass("Call to SDL_GetProperty()");
value = SDL_GetPointerProperty(props, key, NULL);
SDLTest_AssertPass("Call to SDL_GetPointerProperty()");
SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, expected_value) == 0,
"Verify property value was set, got %s, expected %s", value ? (const char *)value : "NULL", expected_value);
}
@ -60,12 +60,12 @@ static int properties_testBasic(void *arg)
for (i = 0; i < 10; ++i) {
SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i);
result = SDL_SetProperty(props, key, NULL);
SDLTest_AssertPass("Call to SDL_SetProperty(NULL)");
result = SDL_SetPointerProperty(props, key, NULL);
SDLTest_AssertPass("Call to SDL_SetPointerProperty(NULL)");
SDLTest_AssertCheck(result == 0,
"Verify property value was set, got: %d", result);
value = SDL_GetProperty(props, key, NULL);
SDLTest_AssertPass("Call to SDL_GetProperty()");
value = SDL_GetPointerProperty(props, key, NULL);
SDLTest_AssertPass("Call to SDL_GetPointerProperty()");
SDLTest_AssertCheck(value == NULL,
"Verify property value was set, got %s, expected NULL", (const char *)value);
}
@ -76,7 +76,7 @@ static int properties_testBasic(void *arg)
"Verify property count, expected 0, got: %d", count);
/* Check default values */
value = SDL_GetProperty(props, "foo", (void *)0xabcd);
value = SDL_GetPointerProperty(props, "foo", (void *)0xabcd);
SDLTest_AssertCheck(value == (void *)0xabcd,
"Verify property, expected 0xabcd, got: %p", value);
value_string = SDL_GetStringProperty(props, "foo", "abcd");
@ -93,12 +93,12 @@ static int properties_testBasic(void *arg)
"Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE");
/* Check data value */
SDLTest_AssertPass("Call to SDL_SetProperty(\"foo\", 0x01)");
SDL_SetProperty(props, "foo", (void *)0x01);
SDLTest_AssertPass("Call to SDL_SetPointerProperty(\"foo\", 0x01)");
SDL_SetPointerProperty(props, "foo", (void *)0x01);
type = SDL_GetPropertyType(props, "foo");
SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_POINTER,
"Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_POINTER, type);
value = SDL_GetProperty(props, "foo", NULL);
value = SDL_GetPointerProperty(props, "foo", NULL);
SDLTest_AssertCheck(value == (void *)0x01,
"Verify property, expected 0x01, got: %p", value);
value_string = SDL_GetStringProperty(props, "foo", NULL);
@ -120,7 +120,7 @@ static int properties_testBasic(void *arg)
type = SDL_GetPropertyType(props, "foo");
SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_STRING,
"Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_STRING, type);
value = SDL_GetProperty(props, "foo", NULL);
value = SDL_GetPointerProperty(props, "foo", NULL);
SDLTest_AssertCheck(value == NULL,
"Verify property, expected NULL, got: %p", value);
value_string = SDL_GetStringProperty(props, "foo", NULL);
@ -142,7 +142,7 @@ static int properties_testBasic(void *arg)
type = SDL_GetPropertyType(props, "foo");
SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_NUMBER,
"Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_NUMBER, type);
value = SDL_GetProperty(props, "foo", NULL);
value = SDL_GetPointerProperty(props, "foo", NULL);
SDLTest_AssertCheck(value == NULL,
"Verify property, expected NULL, got: %p", value);
value_string = SDL_GetStringProperty(props, "foo", NULL);
@ -164,7 +164,7 @@ static int properties_testBasic(void *arg)
type = SDL_GetPropertyType(props, "foo");
SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_FLOAT,
"Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_FLOAT, type);
value = SDL_GetProperty(props, "foo", NULL);
value = SDL_GetPointerProperty(props, "foo", NULL);
SDLTest_AssertCheck(value == NULL,
"Verify property, expected NULL, got: %p", value);
value_string = SDL_GetStringProperty(props, "foo", NULL);
@ -186,7 +186,7 @@ static int properties_testBasic(void *arg)
type = SDL_GetPropertyType(props, "foo");
SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_BOOLEAN,
"Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_BOOLEAN, type);
value = SDL_GetProperty(props, "foo", NULL);
value = SDL_GetPointerProperty(props, "foo", NULL);
SDLTest_AssertCheck(value == NULL,
"Verify property, expected NULL, got: %p", value);
value_string = SDL_GetStringProperty(props, "foo", NULL);
@ -230,8 +230,8 @@ static int properties_testCopy(void *arg)
a = SDL_CreateProperties();
SDL_SetNumberProperty(a, "num", 1);
SDL_SetStringProperty(a, "string", "foo");
SDL_SetProperty(a, "data", &a);
SDL_SetPropertyWithCleanup(a, "cleanup", &a, copy_cleanup, &a);
SDL_SetPointerProperty(a, "data", &a);
SDL_SetPointerPropertyWithCleanup(a, "cleanup", &a, copy_cleanup, &a);
b = SDL_CreateProperties();
SDL_SetNumberProperty(b, "num", 2);
@ -261,11 +261,11 @@ static int properties_testCopy(void *arg)
SDLTest_AssertCheck(string && SDL_strcmp(string, "foo") == 0,
"Checking string property, got \"%s\", expected \"foo\"", string);
data = SDL_GetProperty(b, "data", NULL);
data = SDL_GetPointerProperty(b, "data", NULL);
SDLTest_AssertCheck(data == &a,
"Checking data property, got %p, expected %p", data, &a);
data = SDL_GetProperty(b, "cleanup", NULL);
data = SDL_GetPointerProperty(b, "cleanup", NULL);
SDLTest_AssertCheck(data == NULL,
"Checking cleanup property, got %p, expected NULL", data);
@ -290,9 +290,9 @@ static int properties_testCleanup(void *arg)
props = SDL_CreateProperties();
SDLTest_AssertPass("Call to SDL_SetProperty(cleanup)");
SDLTest_AssertPass("Call to SDL_SetPointerProperty(cleanup)");
count = 0;
SDL_SetPropertyWithCleanup(props, "a", "0", cleanup, &count);
SDL_SetPointerPropertyWithCleanup(props, "a", "0", cleanup, &count);
SDL_ClearProperty(props, "a");
SDLTest_AssertCheck(count == 1,
"Verify cleanup for deleting property, got %d, expected 1", count);
@ -302,7 +302,7 @@ static int properties_testCleanup(void *arg)
for (i = 0; i < 10; ++i) {
SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i);
SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i);
SDL_SetPropertyWithCleanup(props, key, expected_value, cleanup, &count);
SDL_SetPointerPropertyWithCleanup(props, key, expected_value, cleanup, &count);
}
SDL_DestroyProperties(props);
SDLTest_AssertCheck(count == 10,
@ -325,11 +325,11 @@ static int properties_thread(void *arg)
while (!data->done) {
SDL_LockProperties(data->props);
SDL_SetProperty(data->props, "a", "thread_loop");
SDL_SetPointerProperty(data->props, "a", "thread_loop");
SDL_UnlockProperties(data->props);
}
SDL_LockProperties(data->props);
SDL_SetProperty(data->props, "a", "thread_done");
SDL_SetPointerProperty(data->props, "a", "thread_done");
SDL_UnlockProperties(data->props);
return 0;
}
@ -343,7 +343,7 @@ static int properties_testLocking(void *arg)
data.done = SDL_FALSE;
data.props = SDL_CreateProperties();
SDLTest_AssertPass("Setting property to 'init'");
SDL_SetProperty(data.props, "a", "init");
SDL_SetPointerProperty(data.props, "a", "init");
thread = SDL_CreateThread(properties_thread, "properties_thread", &data);
if (thread) {
SDLTest_AssertPass("Waiting for property to change to 'thread_loop'");
@ -351,7 +351,7 @@ static int properties_testLocking(void *arg)
{
SDL_Delay(10);
SDL_LockProperties(data.props);
value = SDL_GetProperty(data.props, "a", NULL);
value = SDL_GetPointerProperty(data.props, "a", NULL);
SDL_UnlockProperties(data.props);
if (!value || SDL_strcmp((const char *)value, "thread_loop") == 0) {
@ -363,9 +363,9 @@ static int properties_testLocking(void *arg)
SDLTest_AssertPass("Setting property to 'main'");
SDL_LockProperties(data.props);
SDL_SetProperty(data.props, "a", "main");
SDL_SetPointerProperty(data.props, "a", "main");
SDL_Delay(100);
value = SDL_GetProperty(data.props, "a", NULL);
value = SDL_GetPointerProperty(data.props, "a", NULL);
SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, "main") == 0,
"After 100ms sleep, property is %s, expected 'main'", value ? (const char *)value : "NULL");
SDL_UnlockProperties(data.props);
@ -373,7 +373,7 @@ static int properties_testLocking(void *arg)
data.done = SDL_TRUE;
SDL_WaitThread(thread, NULL);
value = SDL_GetProperty(data.props, "a", NULL);
value = SDL_GetPointerProperty(data.props, "a", NULL);
SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, "thread_done") == 0,
"After thread complete, property is %s, expected 'thread_done'", value ? (const char *)value : "NULL");
}

View File

@ -1528,20 +1528,20 @@ static int video_getSetWindowData(void *arg)
}
/* Get non-existent data */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name);
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
/* Set data */
SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
/* Get data (twice) */
for (iteration = 1; iteration <= 2; iteration++) {
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [iteration %d]", name, iteration);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
@ -1549,103 +1549,103 @@ static int video_getSetWindowData(void *arg)
/* Set data again twice */
for (iteration = 1; iteration <= 2; iteration++) {
SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
}
/* Get data again */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again]", name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
/* Set data with new data */
SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata2);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata2);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
/* Set data with new data again */
SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata2);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata2);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
/* Get new data */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
/* Set data with NULL to clear */
SDL_SetProperty(SDL_GetWindowProperties(window), name, NULL);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
/* Set data with NULL to clear again */
SDL_SetProperty(SDL_GetWindowProperties(window), name, NULL);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2);
/* Get non-existent data */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name);
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
/* Get non-existent data new name */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name2, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name2, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name2);
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2);
/* Set data (again) */
SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata);
SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata);
/* Get data (again) */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again, after clear]", name);
SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result);
SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name);
/* Set data with NULL name, valid userdata */
SDL_SetProperty(SDL_GetWindowProperties(window), NULL, userdata);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), NULL, userdata);
SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)");
checkInvalidParameterError();
/* Set data with empty name, valid userdata */
SDL_SetProperty(SDL_GetWindowProperties(window), "", userdata);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), "", userdata);
SDLTest_AssertPass("Call to SDL_SetWindowData(name='')");
checkInvalidParameterError();
/* Set data with NULL name, NULL userdata */
SDL_SetProperty(SDL_GetWindowProperties(window), NULL, NULL);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), NULL, NULL);
SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)");
checkInvalidParameterError();
/* Set data with empty name, NULL userdata */
SDL_SetProperty(SDL_GetWindowProperties(window), "", NULL);
SDL_SetPointerProperty(SDL_GetWindowProperties(window), "", NULL);
SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)");
checkInvalidParameterError();
/* Get data with NULL name */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), NULL, NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), NULL, NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)");
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");
/* Get data with empty name */
result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), "", NULL);
result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), "", NULL);
SDLTest_AssertPass("Call to SDL_GetWindowData(name='')");
SDLTest_AssertCheck(result == NULL, "Validate that result is NULL");

View File

@ -78,7 +78,7 @@ static void CreateRenderer(void)
SDL_PropertiesID props;
props = SDL_CreateProperties();
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, SDL_GetRenderDriver(renderer_index));
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER, colorspace);
renderer = SDL_CreateRendererWithProperties(props);

View File

@ -151,7 +151,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char
props = SDL_CreateProperties();
SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, driver);
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window);
if (useVulkan) {
SetupVulkanRenderProperties(vulkan_context, props);
}
@ -217,7 +217,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char
#endif /* HAVE_EGL */
#ifdef SDL_PLATFORM_WIN32
d3d11_device = (ID3D11Device *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, NULL);
d3d11_device = (ID3D11Device *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, NULL);
if (d3d11_device) {
ID3D11Device_AddRef(d3d11_device);
ID3D11Device_GetImmediateContext(d3d11_device, &d3d11_context);
@ -611,13 +611,13 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture)
case SDL_PIXELFORMAT_UNKNOWN:
{
SDL_PropertiesID props = SDL_GetTextureProperties(*texture);
struct SwsContextContainer *sws_container = (struct SwsContextContainer *)SDL_GetProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, NULL);
struct SwsContextContainer *sws_container = (struct SwsContextContainer *)SDL_GetPointerProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, NULL);
if (!sws_container) {
sws_container = (struct SwsContextContainer *)SDL_calloc(1, sizeof(*sws_container));
if (!sws_container) {
return SDL_FALSE;
}
SDL_SetPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL);
SDL_SetPointerPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL);
}
sws_container->context = sws_getCachedContext(sws_container->context, frame->width, frame->height, frame->format, frame->width, frame->height, AV_PIX_FMT_BGRA, SWS_POINT, NULL, NULL, NULL);
if (sws_container->context) {
@ -993,7 +993,7 @@ static SDL_bool GetTextureForD3D11Frame(AVFrame *frame, SDL_Texture **texture)
}
}
ID3D11Resource *dx11_resource = SDL_GetProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL);
ID3D11Resource *dx11_resource = SDL_GetPointerProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL);
if (!dx11_resource) {
SDL_SetError("Couldn't get texture ID3D11Resource interface");
return SDL_FALSE;
@ -1019,7 +1019,7 @@ static SDL_bool GetTextureForVideoToolboxFrame(AVFrame *frame, SDL_Texture **tex
}
props = CreateVideoTextureProperties(frame, SDL_PIXELFORMAT_UNKNOWN, SDL_TEXTUREACCESS_STATIC);
SDL_SetProperty(props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, pPixelBuffer);
SDL_SetPointerProperty(props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, pPixelBuffer);
*texture = SDL_CreateTextureWithProperties(renderer, props);
SDL_DestroyProperties(props);
if (!*texture) {

View File

@ -671,10 +671,10 @@ VulkanVideoContext *CreateVulkanVideoContext(SDL_Window *window)
void SetupVulkanRenderProperties(VulkanVideoContext *context, SDL_PropertiesID props)
{
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, context->instance);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, context->instance);
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER, (Sint64)context->surface);
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, context->physicalDevice);
SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, context->device);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, context->physicalDevice);
SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, context->device);
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, context->presentQueueFamilyIndex);
SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, context->graphicsQueueFamilyIndex);
}

View File

@ -479,8 +479,8 @@ static void loop(void)
for (i = 0; i < state->num_windows; ++i) {
SDL_Window *window = state->windows[i];
SDL_Renderer *renderer = state->renderers[i];
SDL_Texture *arrow_cursor = (SDL_Texture *)SDL_GetProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, NULL);
SDL_Texture *cross_cursor = (SDL_Texture *)SDL_GetProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, NULL);
SDL_Texture *arrow_cursor = (SDL_Texture *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, NULL);
SDL_Texture *cross_cursor = (SDL_Texture *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, NULL);
SDL_SetRenderDrawColor(renderer, 128, 128, 128, 255);
SDL_RenderClear(renderer);
@ -538,8 +538,8 @@ int main(int argc, char *argv[])
SDL_Texture *cursor_arrow = CreateTexture(arrow, renderer);
SDL_Texture *cursor_cross = CreateTexture(cross, renderer);
SDL_SetProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, cursor_arrow);
SDL_SetProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, cursor_arrow);
SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross);
}
/* We only get mouse motion for distinct devices when relative mode is enabled */

View File

@ -151,7 +151,7 @@ int main(int argc, char *argv[])
quit(3);
}
props = SDL_CreateProperties();
SDL_SetProperty(props, "sdl2-compat.external_window", native_window);
SDL_SetPointerProperty(props, "sdl2-compat.external_window", native_window);
SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, WINDOW_W);
SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, WINDOW_H);

View File

@ -116,7 +116,7 @@ static void *CreateWindowWayland(int w, int h)
/* Export the display object from SDL and use it to create a registry object,
* which will enumerate the wl_compositor and xdg_wm_base protocols.
*/
state.wl_display = SDL_GetProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL);
state.wl_display = SDL_GetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL);
if (!state.wl_display) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid 'wl_display' object!");

View File

@ -227,7 +227,7 @@ int main(int argc, char **argv)
}
/* Get the display object and use it to create a registry object, which will enumerate the xdg_wm_base protocol. */
state.wl_display = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL);
state.wl_display = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL);
state.wl_registry = wl_display_get_registry(state.wl_display);
wl_registry_add_listener(state.wl_registry, &wl_registry_listener, NULL);
@ -240,7 +240,7 @@ int main(int argc, char **argv)
}
/* Get the wl_surface object from the SDL_Window, and create a toplevel window with it. */
state.wl_surface = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL);
state.wl_surface = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL);
/* Create the xdg_surface from the wl_surface. */
state.xdg_surface = xdg_wm_base_get_xdg_surface(state.xdg_wm_base, state.wl_surface);