[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15480] trunk/blender/intern/ghost/intern/ GHOST_SystemWin32.cpp: patch from res2k to stop the blender window being upscaled on vista.

Campbell Barton ideasman42 at gmail.com
Tue Jul 8 00:11:11 CEST 2008


Revision: 15480
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15480
Author:   campbellbarton
Date:     2008-07-08 00:11:11 +0200 (Tue, 08 Jul 2008)

Log Message:
-----------
patch from res2k to stop the blender window being upscaled on vista.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp	2008-07-07 21:25:10 UTC (rev 15479)
+++ trunk/blender/intern/ghost/intern/GHOST_SystemWin32.cpp	2008-07-07 22:11:11 UTC (rev 15480)
@@ -302,6 +302,15 @@
 {
 	GHOST_TSuccess success = GHOST_System::init();
 
+	/* Disable scaling on high DPI displays on Vista */
+	HMODULE user32 = ::LoadLibraryA("user32.dll");
+	typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)();
+	LPFNSETPROCESSDPIAWARE SetProcessDPIAware =
+		(LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, "SetProcessDPIAware");
+	if (SetProcessDPIAware)
+		SetProcessDPIAware();
+	FreeLibrary(user32);
+
 	// Determine whether this system has a high frequency performance counter. */
 	m_hasPerformanceCounter = ::QueryPerformanceFrequency((LARGE_INTEGER*)&m_freq) == TRUE;
 	if (m_hasPerformanceCounter) {





More information about the Bf-blender-cvs mailing list