Fix resolutions reported by dxgi-info.exe on high DPI systems
This commit is contained in:
parent
5a4fd95765
commit
f5e3353f82
1 changed files with 5 additions and 1 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* @file tools/dxgi.cpp
|
* @file tools/dxgi.cpp
|
||||||
* @brief todo
|
* @brief Displays information about connected displays and GPUs
|
||||||
*/
|
*/
|
||||||
|
#define WINVER 0x0A00
|
||||||
#include <d3dcommon.h>
|
#include <d3dcommon.h>
|
||||||
#include <dxgi.h>
|
#include <dxgi.h>
|
||||||
|
|
||||||
|
|
@ -27,6 +28,9 @@ int
|
||||||
main(int argc, char *argv[]) {
|
main(int argc, char *argv[]) {
|
||||||
HRESULT status;
|
HRESULT status;
|
||||||
|
|
||||||
|
// Set ourselves as per-monitor DPI aware for accurate resolution values on High DPI systems
|
||||||
|
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||||
|
|
||||||
dxgi::factory1_t::pointer factory_p {};
|
dxgi::factory1_t::pointer factory_p {};
|
||||||
status = CreateDXGIFactory1(IID_IDXGIFactory1, (void **) &factory_p);
|
status = CreateDXGIFactory1(IID_IDXGIFactory1, (void **) &factory_p);
|
||||||
dxgi::factory1_t factory { factory_p };
|
dxgi::factory1_t factory { factory_p };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue