diff --git a/includes/xna-dx/implementations.hpp b/includes/xna-dx/implementations.hpp index 7c0f302..a049b13 100644 --- a/includes/xna-dx/implementations.hpp +++ b/includes/xna-dx/implementations.hpp @@ -31,7 +31,8 @@ namespace xna { std::shared_ptr RenderTarget2D; intptr_t WindowHandle{ 0 }; - inline static constexpr D3D_FEATURE_LEVEL FeatureLevels[7] = + static constexpr int FeatureLevelCount = 7; + inline static constexpr D3D_FEATURE_LEVEL FeatureLevels[FeatureLevelCount] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0, diff --git a/sources/framework-dx/device.cpp b/sources/framework-dx/device.cpp index 9c344ca..20b30fa 100644 --- a/sources/framework-dx/device.cpp +++ b/sources/framework-dx/device.cpp @@ -14,7 +14,6 @@ namespace xna { #if _DEBUG createDeviceFlags = D3D11_CREATE_DEVICE_FLAG::D3D11_CREATE_DEVICE_DEBUG; #endif - const auto& pAdapter = GraphicsAdapter::UseNullDevice() ? NULL : currentAdapter.Implementation->Adapter.Get(); // @@ -39,7 +38,7 @@ namespace xna { //_In_reads_opt_( FeatureLevels ) CONST D3D_FEATURE_LEVEL* pFeatureLevels, FeatureLevels, //UINT FeatureLevels, - 7, + static_cast(FeatureLevelCount), //UINT SDKVersion, D3D11_SDK_VERSION, //_COM_Outptr_opt_ ID3D11Device** ppDevice