Allow Pacer to wait for frames up until a few ms before v-sync for better smoothness and lower latency

This commit is contained in:
Cameron Gutman 2018-08-20 17:53:35 -07:00
commit 6b395c816f
8 changed files with 49 additions and 14 deletions

View file

@ -35,7 +35,7 @@ public:
virtual ~DxVsyncSource();
virtual bool initialize(SDL_Window* window);
virtual bool initialize(SDL_Window* window, int displayFps);
private:
static int vsyncThread(void* context);
@ -45,6 +45,7 @@ private:
SDL_atomic_t m_Stopping;
HMODULE m_Gdi32Handle;
HWND m_Window;
int m_DisplayFps;
PFND3DKMTOPENADAPTERFROMHDC m_D3DKMTOpenAdapterFromHdc;
PFND3DKMTCLOSEADAPTER m_D3DKMTCloseAdapter;