开发者

How to enable vsync in DirectX10

开发者 https://www.devze.com 2023-01-08 01:32 出处:网络
I\'m working on a apps that\'s based on DirectX10 by using SlimDX. I would like to enable vsync similar to DirectX9, but the fps doesn\'t seems to lock to 60Hz(which happens if I\'m using Direct9). I\

I'm working on a apps that's based on DirectX10 by using SlimDX. I would like to enable vsync similar to DirectX9, but the fps doesn't seems to lock to 60Hz(which happens if I'm using Direct9). I'm setting vsync by using this

SwapChain.Present(1, PresentFlags.None);

Did I do something wrong?

Btw, I'm running Wi开发者_开发百科n7 with ATI HD5570 video card. After some googling, I gather that ATI can force vsync on certain games. So I wonder if that's related.

Reference for code to C++ will do as well. I'll translate it myself.

Thanks


First argument of SwapChain.Present is syncInterval. 0 indicates that presentation should occur immediately, without synchronization. Any other value indicates that presentation should be synchonized with the specified next vertical blank. So use it like this:

SwapChain.Present(0, PresentFlags.None);


You can try to force vsync using Catalyst Control Center

How to enable vsync in DirectX10

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号