Rename property define names to have a type suffix
Renamed the following property define names to have a type suffix to match other property names. SDL_PROP_TEXTURE_OPENGL_TEXTURE_TARGET (number) SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET (number) SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY (boolean) SDL_PROP_WINDOW_RENDERER (pointer) SDL_PROP_WINDOW_TEXTUREDATA (pointer)
This commit is contained in:
committed by
Sam Lantinga
parent
cacac6cc34
commit
5af7113842
@@ -196,7 +196,7 @@ static void SDL_SyncIfRequired(SDL_Window *window)
|
||||
|
||||
/* Support for framebuffer emulation using an accelerated renderer */
|
||||
|
||||
#define SDL_PROP_WINDOW_TEXTUREDATA "SDL.internal.window.texturedata"
|
||||
#define SDL_PROP_WINDOW_TEXTUREDATA_POINTER "SDL.internal.window.texturedata"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -240,7 +240,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, U
|
||||
{
|
||||
SDL_RendererInfo info;
|
||||
SDL_PropertiesID props = SDL_GetWindowProperties(window);
|
||||
SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetProperty(props, SDL_PROP_WINDOW_TEXTUREDATA, NULL);
|
||||
SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetProperty(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;
|
||||
@@ -293,7 +293,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, U
|
||||
SDL_DestroyRenderer(renderer);
|
||||
return -1;
|
||||
}
|
||||
SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA, data, SDL_CleanupWindowTextureData, NULL);
|
||||
SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL);
|
||||
|
||||
data->renderer = renderer;
|
||||
} else {
|
||||
@@ -325,7 +325,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, U
|
||||
SDL_TEXTUREACCESS_STREAMING,
|
||||
w, h);
|
||||
if (!data->texture) {
|
||||
/* codechecker_false_positive [Malloc] Static analyzer doesn't realize allocated `data` is saved to SDL_PROP_WINDOW_TEXTUREDATA and not leaked here. */
|
||||
/* codechecker_false_positive [Malloc] Static analyzer doesn't realize allocated `data` is saved to SDL_PROP_WINDOW_TEXTUREDATA_POINTER and not leaked here. */
|
||||
return -1; /* NOLINT(clang-analyzer-unix.Malloc) */
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ static int SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window *window,
|
||||
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
|
||||
data = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA, NULL);
|
||||
data = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
|
||||
if (!data || !data->texture) {
|
||||
return SDL_SetError("No window texture data");
|
||||
}
|
||||
@@ -388,14 +388,14 @@ static int SDL_UpdateWindowTexture(SDL_VideoDevice *unused, SDL_Window *window,
|
||||
|
||||
static void SDL_DestroyWindowTexture(SDL_VideoDevice *unused, SDL_Window *window)
|
||||
{
|
||||
SDL_ClearProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA);
|
||||
SDL_ClearProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER);
|
||||
}
|
||||
|
||||
int SDL_SetWindowTextureVSync(SDL_Window *window, int vsync)
|
||||
{
|
||||
SDL_WindowTextureData *data;
|
||||
|
||||
data = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA, NULL);
|
||||
data = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL);
|
||||
if (!data) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2143,7 +2143,7 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert
|
||||
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);
|
||||
SDL_bool scale_to_display = !(window->flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) && !custom_surface_role &&
|
||||
SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY,
|
||||
SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_SCALE_TO_DISPLAY_BOOLEAN,
|
||||
SDL_GetHintBoolean(SDL_HINT_VIDEO_WAYLAND_SCALE_TO_DISPLAY, SDL_FALSE));
|
||||
|
||||
/* Require viewports for display scaling. */
|
||||
|
||||
Reference in New Issue
Block a user