在使用CreateDevice创建设备时,设置参数D3DPRESENT_PARAMETERS中的PresentationInterval为D3DPRESENT_INTERVAL_ONE或者D3DPRESENT_INTERVAL_DEFAULT,表示在绘图是使用Present操作时,会等待在垂直重扫完毕以后,进行front buffer的切换(若检测到垂直同步完毕,则马上flip调换frontbuffer和backbuffer)。这样,画面的帧率就不会超过显示器(显卡)的刷新率,一般为60HZ。
SDK文档原话:The driver will wait for the vertical retrace period (the runtime will "beam follow" to prevent tearing). Present operations will not be affected more frequently than the screen refresh; the runtime will complete at most one Present operation per adapter refresh period. This is equivalent to using D3DSWAPEFFECT_COPYVSYNC in DirectX 8.1. This option is always available for both windowed and full-screen swap chains.
本文解析了在使用CreateDevice创建设备时,通过设置D3DPRESENT_PARAMETERS中的PresentationInterval为D3DPRESENT_INTERVAL_ONE或D3DPRESENT_INTERVAL_DEFAULT来实现垂直同步的方法。这将使得在绘图时使用Present操作翻转前缓冲区和后缓冲区的过程发生在显示器垂直重扫期间,从而避免画面撕裂现象,并确保帧率不超过显示器的刷新率。

1583

被折叠的 条评论
为什么被折叠?



