Improved error information when renderer creation fails

On Android, if you create a window with SDL_WINDOW_OPENGL, you can't create a Vulkan surface. The error message has been improved to reflect this, and the error is propagated back up to the application.

Also added warn level logging if the renderer couldn't be created.
This commit is contained in:
Sam Lantinga
2025-10-08 19:36:19 -07:00
parent edf5f9ec5c
commit 3316dde0c2
3 changed files with 16 additions and 3 deletions

View File

@@ -1812,7 +1812,6 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
} else {
if (!SDL_Vulkan_CreateSurface(renderer->window, rendererData->instance, NULL, &rendererData->surface)) {
VULKAN_DestroyAll(renderer);
SET_ERROR_MESSAGE("Vulkan_CreateSurface() failed");
return VK_ERROR_UNKNOWN;
}
}