diff --git a/includes/xna-dx/implementations.hpp b/includes/xna-dx/implementations.hpp index 2bf9f36..ff89487 100644 --- a/includes/xna-dx/implementations.hpp +++ b/includes/xna-dx/implementations.hpp @@ -17,7 +17,9 @@ namespace xna { D3D11_BLEND_DESC Description{}; float BlendFactor[4]{ 1.0F, 1.0F, 1.0F, 1.0F }; UINT SampleMask{ 0xffffffff }; - comptr BlendState; + comptr BlendState; + + static constexpr int MAX_RENDER_TARGETS = 8; }; struct SpriteFont::PlatformImplementation { diff --git a/includes/xna/graphics/blendstate.hpp b/includes/xna/graphics/blendstate.hpp index bd5415c..751e93b 100644 --- a/includes/xna/graphics/blendstate.hpp +++ b/includes/xna/graphics/blendstate.hpp @@ -169,8 +169,6 @@ namespace xna { //that is blending source and destination data using alpha while assuming the color data contains no alpha information. static std::unique_ptr NonPremultiplied(); }; - - using PBlendState = std::shared_ptr; } #endif \ No newline at end of file diff --git a/sources/framework-dx/blendstate.cpp b/sources/framework-dx/blendstate.cpp index e48064f..794a675 100644 --- a/sources/framework-dx/blendstate.cpp +++ b/sources/framework-dx/blendstate.cpp @@ -142,7 +142,7 @@ namespace xna { } void BlendState::RenderTargets(BlendRenderTarget const* value, size_t size) { - for (size_t i = 0; i < size && i < 8; ++i) { + for (size_t i = 0; i < size && i < Implementation->MAX_RENDER_TARGETS; ++i) { Implementation->Description.RenderTarget[i].BlendEnable = value[i].Enabled; Implementation->Description.RenderTarget[i].SrcBlend = DxHelpers::BlendToDx(value[i].Source); Implementation->Description.RenderTarget[i].DestBlend = DxHelpers::BlendToDx(value[i].Destination);