Skip to content

Commit

Permalink
Don't run as DPI-aware process here.
Browse files Browse the repository at this point in the history
Use a manifest that declares DPI-awareness for the game instead.
  • Loading branch information
Spodi committed Nov 9, 2023
1 parent 3a700a4 commit 43e08d0
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/graphic/Fast3D/gfx_dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,24 +466,24 @@ void gfx_dxgi_init(const char* game_name, const char* gfx_api_name, bool start_i

ATOM winclass = RegisterClassExW(&wcex);

run_as_dpi_aware([&]() {
// We need to be dpi aware when calculating the size
RECT wr = { 0, 0, width, height };
AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
dxgi.current_width = wr.right - wr.left;
dxgi.current_height = wr.bottom - wr.top;
dxgi.monitor_list = GetMonitorList();
dxgi.posX = posX;
dxgi.posY = posY;
if (!GetMonitorAtCoords(dxgi.monitor_list, dxgi.posX, dxgi.posY, dxgi.current_width, dxgi.current_height,
dxgi.h_Monitor)) {
dxgi.posX = 100;
dxgi.posY = 100;
}

dxgi.h_wnd = CreateWindowW(WINCLASS_NAME, w_title, WS_OVERLAPPEDWINDOW, dxgi.posX + wr.left, dxgi.posY + wr.top,
dxgi.current_width, dxgi.current_height, nullptr, nullptr, nullptr, nullptr);
});
// run_as_dpi_aware([&]() {
// We need to be dpi aware when calculating the size
RECT wr = { 0, 0, width, height };
AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);
dxgi.current_width = wr.right - wr.left;
dxgi.current_height = wr.bottom - wr.top;
dxgi.monitor_list = GetMonitorList();
dxgi.posX = posX;
dxgi.posY = posY;
if (!GetMonitorAtCoords(dxgi.monitor_list, dxgi.posX, dxgi.posY, dxgi.current_width, dxgi.current_height,
dxgi.h_Monitor)) {
dxgi.posX = 100;
dxgi.posY = 100;
}

dxgi.h_wnd = CreateWindowW(WINCLASS_NAME, w_title, WS_OVERLAPPEDWINDOW, dxgi.posX + wr.left, dxgi.posY + wr.top,
dxgi.current_width, dxgi.current_height, nullptr, nullptr, nullptr, nullptr);
// });

load_dxgi_library();

Expand Down

0 comments on commit 43e08d0

Please sign in to comment.