[host] dxgi: use SDK versionhelpers.h to test for Windows version

Also, changed logic so that Windows versions before 8 is not treated as 10.
This commit is contained in:
Quantum authored and Geoffrey McRae committed 2021-07-20 11:34:57 +10:00
1 parent 5421bd8b1d
commit d82333519c
1 file changed
+6 -5
@@ -35,6 +35,7 @@
#include <dxgi.h>
#include <d3d11.h>
#include <d3dcommon.h>
#include <versionhelpers.h>
#include "dxgi_extra.h"
@@ -340,15 +341,15 @@ static bool dxgi_init(void)
const D3D_FEATURE_LEVEL * featureLevels;
unsigned int featureLevelCount;
if (IsWindows8())
if (IsWindows10OrGreater())
{
featureLevels = win8;
featureLevelCount = sizeof(win8) / sizeof(D3D_FEATURE_LEVEL);
featureLevels = win10;
featureLevelCount = ARRAY_LENGTH(win10);
}
else
{
featureLevels = win10;
featureLevelCount = sizeof(win10) / sizeof(D3D_FEATURE_LEVEL);
featureLevels = win8;
featureLevelCount = ARRAY_LENGTH(win8);
}
IDXGIAdapter * tmp;