|
发表于 2011-7-16 22:23:00
|
显示全部楼层
Re:directx 如何实现帧同步?
以下是在网上找到的 DirectDraw 垂直同步源代码
- //============================================================
- // win_ddraw_wait_vsync
- //============================================================
- void win_ddraw_wait_vsync(void)
- {
- HRESULT result;
- BOOL is_vblank;
- // if we're not already in VBLANK, wait for it
- result = IDirectDraw::GetVerticalBlankStatus(ddraw, &is_vblank);
- if (result == DD_OK && !is_vblank)
- {
- result = IDirectDraw::WaitForVerticalBlank(ddraw, DDWAITVB_BLOCKBEGIN, 0);
- }
- }
- //============================================================
复制代码 |
|