From bfee544685f3fd847a230c5c48f2018e30c7195e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 07:19:20 -0700 Subject: [PATCH] Changed SDL_GetWindowPixelFormat() to return SDL_PixelFormat Fixes https://github.com/libsdl-org/SDL/issues/10257 Closes https://github.com/libsdl-org/SDL/pull/10258 --- include/SDL3/SDL_video.h | 2 +- src/dynapi/SDL_dynapi_procs.h | 2 +- src/render/psp/SDL_render_psp.c | 2 +- src/video/SDL_video.c | 2 +- test/testautomation_video.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 9a22dbd7d..a1e04737f 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -781,7 +781,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, si * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window); +extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window); /** * Get a list of valid windows. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 63034e6b9..1212c524a 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -525,7 +525,7 @@ SDL_DYNAPI_PROC(const SDL_Rect*,SDL_GetWindowMouseRect,(SDL_Window *a),(a),retur SDL_DYNAPI_PROC(int,SDL_GetWindowOpacity,(SDL_Window *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowParent,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetWindowPixelDensity,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(Uint32,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowPosition,(SDL_Window *a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetWindowProperties,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 9187b7331..6ba77415d 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -192,7 +192,7 @@ static void psp_on_vblank(u32 sub, PSP_RenderData *data) } } -static int PixelFormatToPSPFMT(Uint32 format) +static int PixelFormatToPSPFMT(SDL_PixelFormat format) { switch (format) { case SDL_PIXELFORMAT_BGR565: diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0d676cc33..a143bbfa5 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2012,7 +2012,7 @@ void *SDL_GetWindowICCProfile(SDL_Window *window, size_t *size) return _this->GetWindowICCProfile(_this, window, size); } -Uint32 SDL_GetWindowPixelFormat(SDL_Window *window) +SDL_PixelFormat SDL_GetWindowPixelFormat(SDL_Window *window) { SDL_DisplayID displayID; const SDL_DisplayMode *mode; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index b8b995a3c..50849c8ca 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -731,7 +731,7 @@ static int video_getWindowPixelFormat(void *arg) { const char *title = "video_getWindowPixelFormat Test Window"; SDL_Window *window; - Uint32 format; + SDL_PixelFormat format; /* Call against new test window */ window = createVideoSuiteTestWindow(title);