walbourn / directx-vs-templates

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

Add opt-in support for the DirectX Agilty SDK #45

Closed walbourn closed 3 years ago

walbourn commented 3 years ago

The Win32 templates should be updated to support the Agility SDK. Specifically in Main.cpp:

extern "C"
{
    // Indicates to hybrid graphics systems to prefer the discrete part by default
    __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
    __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;

#ifdef USING_D3D12_AGILITY_SDK
    // Used to enable the "Agility SDK" components
    __declspec(dllexport) extern const UINT D3D12SDKVersion = D3D12_SDK_VERSION;
    __declspec(dllexport) extern const char* D3D12SDKPath = u8".\\D3D12\\";
#endif
}

That said, currently the Agility SDK doesn't have any preprocessor defines I can use here, so it still requires manual work to add it.

walbourn commented 3 years ago

See this commit