Skip to content

Commit

Permalink
Allow true vsync off when aero is on. Requires Dwmapi.lib linking.
Browse files Browse the repository at this point in the history
  • Loading branch information
xwidghet committed Aug 21, 2016
1 parent 45e0787 commit d51205b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/RageDisplay_D3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <d3d9.h>
#include <dxerr.h>

#include <Dwmapi.h>

#include "archutils/Win32/GraphicsWindow.h"

// Static libraries
Expand Down Expand Up @@ -474,7 +476,10 @@ static void SetPresentParametersFromVideoModeParams( const VideoModeParams &p, D
pD3Dpp->EnableAutoDepthStencil = TRUE;
pD3Dpp->AutoDepthStencilFormat = D3DFMT_D16;

if( p.windowed )
BOOL aeroOn = false;
DwmIsCompositionEnabled(&aeroOn);

if (p.windowed && !aeroOn)
pD3Dpp->PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
else
pD3Dpp->PresentationInterval = p.vsync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
Expand Down

0 comments on commit d51205b

Please sign in to comment.