Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle VSync in D3D windowed mode #648

Open
mctb32 opened this issue Jan 10, 2025 · 2 comments
Open

Toggle VSync in D3D windowed mode #648

mctb32 opened this issue Jan 10, 2025 · 2 comments

Comments

@mctb32
Copy link

mctb32 commented Jan 10, 2025

I'm on Win 11 and I see that VSync is permanenty enabled in windowed mode in both DX11 and DX12 backends. It would be great to enable vsync off feature, especially for games that use the popular borderless fulscreen mode.

I found this article describing how to enable it: https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/variable-refresh-rate-displays

I can confirm that adding those swapchain and present flags works correctly and now vsync can be toggled in windowed mode. I thought about making a pull request, but I'm not sure where to initialize the tearing capability flag and where to store it so that it can be accessed in both swapchain init and present functions.

@TheMostDiligent
Copy link
Contributor

Yes, there is an issue for this #325 and a pull request (#635)
Didn't have time to merge it yet.

@mctb32
Copy link
Author

mctb32 commented Jan 10, 2025

Sorry, I missed those.

The code in the pull request looks exactly how I tested it. But according to the article I found, in production you should also check for the capability flag. Also, I don't think those flags should be used when in fullscreen mode, but I'm not 100% sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants