Set DPI awareness in manifest

instead of doing it at runtime, still works in WinXP according to StepS in the IRC,
should probably be tested there to be sure
This commit is contained in:
Peter Tissen 2015-03-05 02:06:11 +01:00
parent 4c827d1b3e
commit e7e8bf9221
4 changed files with 14 additions and 23 deletions

7
Windows/PPSSPP.manifest Normal file
View file

@ -0,0 +1,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
</windowsSettings>
</application>
</assembly>

View file

@ -437,6 +437,9 @@
<Project>{004b8d11-2be3-4bd9-ab40-2be04cf2096f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Manifest Include="PPSSPP.manifest" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View file

@ -332,4 +332,7 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
<ItemGroup>
<Manifest Include="PPSSPP.manifest" />
</ItemGroup>
</Project>

View file

@ -71,9 +71,6 @@ static std::string langRegion;
static std::string osName;
static std::string gpuDriverVersion;
typedef BOOL(WINAPI *isProcessDPIAwareProc)();
typedef BOOL(WINAPI *setProcessDPIAwareProc)();
void LaunchBrowser(const char *url) {
ShellExecute(NULL, L"open", ConvertUTF8ToWString(url).c_str(), NULL, NULL, SW_SHOWNORMAL);
}
@ -328,22 +325,6 @@ bool System_InputBoxGetWString(const wchar_t *title, const std::wstring &default
}
}
void MakePPSSPPDPIAware()
{
isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)
GetProcAddress(GetModuleHandle(TEXT("User32.dll")), "IsProcessDPIAware");
setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)
GetProcAddress(GetModuleHandle(TEXT("User32.dll")), "SetProcessDPIAware");
// If we're not DPI aware, make it so, but do it safely.
if (isDPIAwareProc != nullptr) {
if (!isDPIAwareProc()) {
if (setDPIAwareProc != nullptr)
setDPIAwareProc();
}
}
}
std::vector<std::wstring> GetWideCmdLine() {
wchar_t **wargv;
@ -361,9 +342,6 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
CoInitializeEx(NULL, COINIT_MULTITHREADED);
// Windows Vista and above: alert Windows that PPSSPP is DPI aware,
// so that we don't flicker in fullscreen on some PCs.
MakePPSSPPDPIAware();
// FMA3 support in the 2013 CRT is broken on Vista and Windows 7 RTM (fixed in SP1). Just disable it.
#ifdef _M_X64