1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/includes/xna/graphics/blendstate.hpp

83 lines
3.8 KiB
C++
Raw Normal View History

2024-03-18 15:41:46 -03:00
#ifndef XNA_GRAPHICS_BLENDSTATE_HPP
#define XNA_GRAPHICS_BLENDSTATE_HPP
2024-06-22 22:12:43 -03:00
#include "../common/color.hpp"
2024-04-13 21:04:12 -03:00
#include "../default.hpp"
2024-05-19 21:22:34 -03:00
#include "gresource.hpp"
2024-03-18 15:41:46 -03:00
namespace xna {
2024-04-24 11:44:41 -03:00
struct BlendRenderTarget;
2024-03-24 16:12:17 -03:00
2024-06-22 22:05:35 -03:00
//Contains blend state for the device.
2024-05-19 21:22:34 -03:00
class BlendState : public GraphicsResource {
2024-03-18 15:41:46 -03:00
public:
2024-05-19 21:22:34 -03:00
BlendState();
BlendState(sptr<GraphicsDevice> const& device);
2024-06-22 22:05:35 -03:00
//Gets or sets the arithmetic operation when blending alpha values. The default is BlendFunction.Add.
BlendFunction AlphaBlendFunction() const;
//Gets or sets the arithmetic operation when blending alpha values. The default is BlendFunction.Add.
void AlphaBlendFunction(BlendFunction value);
//Gets or sets the blend factor for the destination alpha, which is the percentage of the destination alpha included in the blended result. The default is Blend.One.
Blend AlphaDestinationBlend() const;
//Gets or sets the blend factor for the destination alpha, which is the percentage of the destination alpha included in the blended result. The default is Blend.One.
void AlphaDestinationBlend(Blend value);
//Gets or sets the alpha blend factor. The default is Blend.One.
Blend AlphaSourceBlend() const;
//Gets or sets the alpha blend factor. The default is Blend.One.
void AlphaSourceBlend(Blend value);
//Gets or sets the arithmetic operation when blending color values. The default is BlendFunction.Add.
BlendFunction ColorBlendFunction() const;
//Gets or sets the arithmetic operation when blending color values. The default is BlendFunction.Add.
void ColorBlendFunction(BlendFunction value);
//Gets or sets the blend factor for the destination color. The default is Blend.One.
Blend ColorDestinationBlend() const;
//Gets or sets the blend factor for the destination color. The default is Blend.One.
void ColorDestinationBlend(Blend value);
//Gets or sets the blend factor for the source color. The default is Blend.One.
Blend ColorSourceBlend() const;
//Gets or sets the blend factor for the source color. The default is Blend.One.
void ColorSourceBlend(Blend value);
//Gets or sets the four-component (RGBA) blend factor for alpha blending.
Color BlendFactor() const;
//Gets or sets the four-component (RGBA) blend factor for alpha blending.
void BlendFactor(Color const& value);
//Gets or sets a bitmask which defines which samples can be written during multisampling. The default is 0xffffffff.
Int MultiSampleMask() const;
//Gets or sets a bitmask which defines which samples can be written during multisampling. The default is 0xffffffff.
void MultiSampleMast(Int value);
//Specifies whether to use alpha-to-coverage as a multisampling technique when setting a pixel to a render target.
void AlphaToCoverageEnable(bool value);
//Specifies whether to enable independent blending in simultaneous render targets
void IndependentBlendEnable(bool value);
2024-05-19 21:22:34 -03:00
void RenderTargets(std::vector<BlendRenderTarget> const& value);
2024-06-22 22:05:35 -03:00
bool Initialize();
bool Apply();
2024-04-13 21:04:12 -03:00
2024-06-22 22:05:35 -03:00
//A built-in state object with settings for opaque blend,
//that is overwriting the source with the destination data.
2024-05-19 21:22:34 -03:00
static uptr<BlendState> Opaque();
2024-06-22 22:05:35 -03:00
//A built-in state object with settings for alpha blend,
//that is blending the source and destination data using alpha.
2024-05-19 21:22:34 -03:00
static uptr<BlendState> AlphaBlend();
2024-06-22 22:05:35 -03:00
//A built-in state object with settings for additive blend,
//that is adding the destination data to the source data without using alpha.
2024-05-19 21:22:34 -03:00
static uptr<BlendState> Additive();
2024-06-22 22:05:35 -03:00
//A built-in state object with settings for blending with non-premultipled alpha,
//that is blending source and destination data using alpha while assuming the color data contains no alpha information.
2024-05-19 21:22:34 -03:00
static uptr<BlendState> NonPremultiplied();
public:
struct PlatformImplementation;
uptr<PlatformImplementation> impl = nullptr;
2024-03-21 16:01:47 -03:00
};
2024-06-24 15:11:07 -03:00
using PBlendState = sptr<BlendState>;
2024-03-18 15:41:46 -03:00
}
#endif