Remove calls to dwmFlush - Were never called before and cause frame drops with opengl renderer
This commit is contained in:
@@ -416,19 +416,6 @@ void GraphicsWindow::Initialize( bool bD3D )
|
|||||||
// A few things need to be handled differently for D3D.
|
// A few things need to be handled differently for D3D.
|
||||||
g_bD3D = bD3D;
|
g_bD3D = bD3D;
|
||||||
|
|
||||||
//keeping xp on life support -- check for vista+ for dwm
|
|
||||||
if (IsWindowsVistaOrGreater())
|
|
||||||
{
|
|
||||||
hInstanceDwmapi = LoadLibraryA("dwmapi.dll");
|
|
||||||
}
|
|
||||||
|
|
||||||
//if we have dwm, get function pointers to the dll functions
|
|
||||||
if( hInstanceDwmapi != nullptr )
|
|
||||||
{
|
|
||||||
PFN_DwmFlush = (HRESULT (WINAPI *)(VOID))GetProcAddress( hInstanceDwmapi, "DwmFlush" );
|
|
||||||
PFN_DwmIsCompositionEnabled = (HRESULT (WINAPI *)(BOOL*))GetProcAddress( hInstanceDwmapi, "DwmIsCompositionEnabled" );
|
|
||||||
}
|
|
||||||
|
|
||||||
AppInstance inst;
|
AppInstance inst;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -509,20 +496,6 @@ void GraphicsWindow::Update()
|
|||||||
|
|
||||||
HOOKS->SetHasFocus( g_bHasFocus );
|
HOOKS->SetHasFocus( g_bHasFocus );
|
||||||
|
|
||||||
if (g_CurrentParams.vsync)
|
|
||||||
{
|
|
||||||
//if we can use DWM
|
|
||||||
if( hInstanceDwmapi != nullptr )
|
|
||||||
{
|
|
||||||
BOOL compositeEnabled = true;
|
|
||||||
PFN_DwmIsCompositionEnabled(&compositeEnabled);
|
|
||||||
if (compositeEnabled)
|
|
||||||
{
|
|
||||||
PFN_DwmFlush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( g_bResolutionChanged && DISPLAY != nullptr )
|
if( g_bResolutionChanged && DISPLAY != nullptr )
|
||||||
{
|
{
|
||||||
//LOG->Warn( "Changing resolution" );
|
//LOG->Warn( "Changing resolution" );
|
||||||
|
|||||||
@@ -35,11 +35,6 @@ namespace GraphicsWindow
|
|||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
HWND GetHwnd();
|
HWND GetHwnd();
|
||||||
|
|
||||||
//dwm functions for vista+
|
|
||||||
static HINSTANCE hInstanceDwmapi = nullptr;
|
|
||||||
static HRESULT(WINAPI* PFN_DwmIsCompositionEnabled)(BOOL*);
|
|
||||||
static HRESULT (WINAPI* PFN_DwmFlush)(VOID);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user