mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-01 19:44:40 +00:00
Added support for simulated vsync in the renderer
This kicks in if the platform doesn't support vsync directly, or if the present fails for some reason (e.g. minimized on some platforms) Fixes https://github.com/libsdl-org/SDL/issues/5134
This commit is contained in:
@@ -2288,7 +2288,7 @@ done:
|
||||
return status;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
D3D11_RenderPresent(SDL_Renderer * renderer)
|
||||
{
|
||||
D3D11_RenderData *data = (D3D11_RenderData *) renderer->driverdata;
|
||||
@@ -2334,7 +2334,7 @@ D3D11_RenderPresent(SDL_Renderer * renderer)
|
||||
*
|
||||
* TODO, WinRT: consider throwing an exception if D3D11_RenderPresent fails, especially if there is a way to salvage debug info from users' machines
|
||||
*/
|
||||
if ( result == DXGI_ERROR_DEVICE_REMOVED ) {
|
||||
if (result == DXGI_ERROR_DEVICE_REMOVED) {
|
||||
D3D11_HandleDeviceLost(renderer);
|
||||
} else if (result == DXGI_ERROR_INVALID_CALL) {
|
||||
/* We probably went through a fullscreen <-> windowed transition */
|
||||
@@ -2342,7 +2342,9 @@ D3D11_RenderPresent(SDL_Renderer * renderer)
|
||||
} else {
|
||||
WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGISwapChain::Present"), result);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
|
||||
|
||||
Reference in New Issue
Block a user