Windows: Start at a sensible window size if high-DPI. Avoids the worst of #9437 but does not fix it.

This commit is contained in:
Henrik Rydgård committed 2017-03-17 13:22:00 +01:00
1 parent 6dcbed6659
commit aefad893f8
4 files changed
+25 -20

No files matched your search

+17
View File
@@ -187,6 +187,21 @@ std::string System_GetProperty(SystemProperty prop) {
// Ugly!
extern WindowsAudioBackend *winAudioBackend;
#ifdef _WIN32
#if PPSSPP_PLATFORM(UWP)
static int ScreenDPI() {
return 96; // TODO UWP
}
#else
static int ScreenDPI() {
HDC screenDC = GetDC(nullptr);
int dotsPerInch = GetDeviceCaps(screenDC, LOGPIXELSY);
ReleaseDC(nullptr, screenDC);
return dotsPerInch;
}
#endif
#endif
int System_GetPropertyInt(SystemProperty prop) {
switch (prop) {
case SYSPROP_AUDIO_SAMPLE_RATE:
@@ -195,6 +210,8 @@ int System_GetPropertyInt(SystemProperty prop) {
return 60000;
case SYSPROP_DEVICE_TYPE:
return DEVICE_TYPE_DESKTOP;
case SYSPROP_DISPLAY_DPI:
return ScreenDPI();
default:
return -1;
}