summaryrefslogtreecommitdiffstats
path: root/Projects/Asteroids/src/WinWrapper.cpp
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-02 17:00:04 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-02 17:00:04 +0000
commit2c52924e586513c4c715cd0d69cb429ecc50c6e2 (patch)
tree6a8d0b35fe8d36c26b9125deb878887c3436b306 /Projects/Asteroids/src/WinWrapper.cpp
parentUpdated submodules (added DILIGENT_NO_HLSL option, updated ImGUI shaders, fix... (diff)
downloadDiligentEngine-2c52924e586513c4c715cd0d69cb429ecc50c6e2.tar.gz
DiligentEngine-2c52924e586513c4c715cd0d69cb429ecc50c6e2.zip
Asteroids demo: disabled DPI scaling
Diffstat (limited to 'Projects/Asteroids/src/WinWrapper.cpp')
-rw-r--r--Projects/Asteroids/src/WinWrapper.cpp32
1 files changed, 2 insertions, 30 deletions
diff --git a/Projects/Asteroids/src/WinWrapper.cpp b/Projects/Asteroids/src/WinWrapper.cpp
index ebdfc33..6bf0e6d 100644
--- a/Projects/Asteroids/src/WinWrapper.cpp
+++ b/Projects/Asteroids/src/WinWrapper.cpp
@@ -65,23 +65,6 @@ bool CheckDll(char const* dllName)
return true;
}
-
-UINT SetupDPI()
-{
- // Just do system DPI awareness for now for simplicity... scale the 3D content
- SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE);
-
- UINT dpiX = 0, dpiY;
- POINT pt = {1, 1};
- auto hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
- if (SUCCEEDED(GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY))) {
- return dpiX;
- } else {
- return 96; // default
- }
-}
-
-
void ResetCameraView()
{
auto center = XMVectorSet(0.0f, -0.4f*SIM_DISC_RADIUS, 0.0f, 0.0f);
@@ -144,8 +127,8 @@ LRESULT CALLBACK WindowProc(
gSettings.windowWidth = (int)ww;
gSettings.windowHeight = (int)wh;
- gSettings.renderWidth = (UINT)(double(gSettings.windowWidth) * gSettings.renderScale);
- gSettings.renderHeight = (UINT)(double(gSettings.windowHeight) * gSettings.renderScale);
+ gSettings.renderWidth = gSettings.windowWidth;
+ gSettings.renderHeight = gSettings.windowHeight;
// Update camera projection
if(gSettings.renderWidth !=0 && gSettings.renderHeight !=0)
@@ -401,15 +384,6 @@ int main(int argc, char** argv)
gVulkanAvailable = CheckDll("vulkan-1.dll");
#endif
- // Must be done before any windowing-system-like things or else virtualization will kick in
- auto dpi = SetupDPI();
- // By default render at the lower resolution and scale up based on system settings
- gSettings.renderScale = 96.0 / double(dpi);
-
- // Scale default window size based on dpi
- gSettings.windowWidth *= dpi / 96;
- gSettings.windowHeight *= dpi / 96;
-
gSettings.mode = Settings::RenderMode::Undefined;
for (int a = 1; a < argc; ++a) {
if (_stricmp(argv[a], "-close_after") == 0 && a + 1 < argc) {
@@ -429,8 +403,6 @@ int main(int argc, char** argv)
} else if (_stricmp(argv[a], "-window") == 0 && a + 2 < argc) {
gSettings.windowWidth = atoi(argv[++a]);
gSettings.windowHeight = atoi(argv[++a]);
- } else if (_stricmp(argv[a], "-render_scale") == 0 && a + 1 < argc) {
- gSettings.renderScale = atof(argv[++a]);
} else if (_stricmp(argv[a], "-locked_fps") == 0 && a + 1 < argc) {
gSettings.lockedFrameRate = atoi(argv[++a]);
} else if (_stricmp(argv[a], "-threads") == 0 && a + 1 < argc) {