Skip to content

Commit

Permalink
Update FNA3D_Driver_SDL.c
Browse files Browse the repository at this point in the history
Fix a timing issue with present mode queries happening before ClaimWindow
  • Loading branch information
flibitijibibo authored Aug 28, 2024
1 parent 1698e40 commit 3164606
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/FNA3D_Driver_SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3164606

Please sign in to comment.