diff --git a/src/gpu/d3d11/SDL_gpu_d3d11.c b/src/gpu/d3d11/SDL_gpu_d3d11.c index bd741c0422e11..e2df614302544 100644 --- a/src/gpu/d3d11/SDL_gpu_d3d11.c +++ b/src/gpu/d3d11/SDL_gpu_d3d11.c @@ -5348,7 +5348,7 @@ static SDL_GPUTextureFormat D3D11_GetSwapchainTextureFormat( if (windowData == NULL) { SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, window has not been claimed!"); - return 0; + return SDL_GPU_TEXTUREFORMAT_INVALID; } return windowData->textureContainer.header.info.format; diff --git a/src/gpu/metal/SDL_gpu_metal.m b/src/gpu/metal/SDL_gpu_metal.m index c251267ea3675..aee3bdbb6edd8 100644 --- a/src/gpu/metal/SDL_gpu_metal.m +++ b/src/gpu/metal/SDL_gpu_metal.m @@ -3563,7 +3563,7 @@ static SDL_GPUTextureFormat METAL_GetSwapchainTextureFormat( if (windowData == NULL) { SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, window has not been claimed!"); - return 0; + return SDL_GPU_TEXTUREFORMAT_INVALID; } return windowData->textureContainer.header.info.format; diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c index 174be59033507..3c31422d4a0b3 100644 --- a/src/gpu/vulkan/SDL_gpu_vulkan.c +++ b/src/gpu/vulkan/SDL_gpu_vulkan.c @@ -10132,12 +10132,12 @@ static SDL_GPUTextureFormat VULKAN_GetSwapchainTextureFormat( if (windowData == NULL) { SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, window has not been claimed!"); - return 0; + return SDL_GPU_TEXTUREFORMAT_INVALID; } if (windowData->swapchainData == NULL) { SDL_LogError(SDL_LOG_CATEGORY_GPU, "Cannot get swapchain format, swapchain is currently invalid!"); - return 0; + return SDL_GPU_TEXTUREFORMAT_INVALID; } return SwapchainCompositionToSDLFormat(