walbourn / directx-vs-templates

Direct3D Visual Studio Templates
https://walbourn.github.io/direct3d-game-visual-studio-templates-redux/
MIT License
410 stars 55 forks source link

DpiChanged capability #12

Open mediabuff opened 6 years ago

mediabuff commented 6 years ago

would it be possible to add boiler plate code for dpi changes in both win32 and uwp templates ?

walbourn commented 6 years ago

The Win32 templates include embedded manifest elements which indicate that the EXE is "dpiAware". This means the app is only told true pixel sizes in all cases, which is typical for Win32 Direct3D apps & games. They already have support for multiple resolutions.

The UWP templates will also communicate 'true pixels' to the Game module. You can also add more code to the OnDpiChanged handler in Main.cpp.

What in particular were you looking for?

mediabuff commented 6 years ago

I meant hooking into into WM_DPICHANGED etc. to structure the template for building modern DPI aware applications. Much like DynamicDPI SDK sample. Much of this can be abstracted and setup in the DirectX devices/contexts etc. appropriately. A uniformity brought into Win32 and UWP apps esp. targeting those that build their UI frameworks directly on DirectX (not using XAML or WPF).