From 31646062ed44a5e70ab774a22f741bab9bd9ba87 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 27 Aug 2024 22:24:24 -0400 Subject: [PATCH] Update FNA3D_Driver_SDL.c Fix a timing issue with present mode queries happening before ClaimWindow --- src/FNA3D_Driver_SDL.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/FNA3D_Driver_SDL.c b/src/FNA3D_Driver_SDL.c index 51ab9fa4..1c0a64ab 100644 --- a/src/FNA3D_Driver_SDL.c +++ b/src/FNA3D_Driver_SDL.c @@ -3999,27 +3999,28 @@ static FNA3D_Device* SDLGPU_CreateDevice( } } - if (!XNAToSDL_PresentMode( + if (!SDL_GpuClaimWindow( renderer->device, - presentationParameters->deviceWindowHandle, - presentationParameters->presentationInterval, - &desiredPresentMode + presentationParameters->deviceWindowHandle )) { - FNA3D_LogError("Failed to set suitable present mode!"); + FNA3D_LogError("Failed to claim window!"); SDL_free(renderer); SDL_free(result); return NULL; } - if (!SDL_GpuClaimWindow( + if (!XNAToSDL_PresentMode( renderer->device, - presentationParameters->deviceWindowHandle + presentationParameters->deviceWindowHandle, + presentationParameters->presentationInterval, + &desiredPresentMode )) { - FNA3D_LogError("Failed to claim window!"); + FNA3D_LogError("Failed to set suitable present mode!"); SDL_free(renderer); SDL_free(result); return NULL; } + if (!SDL_GpuSetSwapchainParameters( renderer->device, presentationParameters->deviceWindowHandle,