1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/framework/graphics/blendstate.hpp
2024-03-24 16:12:17 -03:00

42 lines
1.0 KiB
C++

#ifndef XNA_GRAPHICS_BLENDSTATE_HPP
#define XNA_GRAPHICS_BLENDSTATE_HPP
#include "../types.hpp"
#include "../forward.hpp"
#include "../enums.hpp"
namespace xna {
struct BlendRenderTarget {
bool Enabled{ true };
Blend Source{ Blend::SourceAlpha };
Blend Destination{ Blend::InverseSourceAlpha };
BlendOperation Operation{ BlendOperation::Add };
Blend SourceAlpha{ Blend::One };
Blend DestinationAlpha{ Blend::Zero };
BlendOperation OperationAlpha{ BlendOperation::Add };
ColorWriteChannels WriteMask{ ColorWriteChannels::All };
constexpr BlendRenderTarget() = default;
};
using PBlendRenderTarget = sptr<BlendRenderTarget>;
class IBlendState {
public:
virtual ~IBlendState() {}
static PBlendState Opaque();
static PBlendState AlphaBlend();
static PBlendState Additive();
static PBlendState NonPremultiplied();
virtual bool Apply(GraphicsDevice* device) = 0;
public:
bool AlphaToCoverage{ false };
bool IndependentBlendEnable{ false };
PBlendRenderTarget RenderTargets[8];
};
}
#endif