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:
1 parent
bf03dee866
commit
5bf6bc4d7d
55 files changed
+221
-257
No files matched your search
@@ -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, ""));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+12
-12
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
@@ -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__);
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user