class EE::Graphics::BlendMode¶
Overview¶
#include <blendmode.hpp> class BlendMode { public: // enums enum Equation; enum Factor; // fields Factor colorSrcFactor; Factor colorDstFactor; Equation colorEquation; Factor alphaSrcFactor; Factor alphaDstFactor; Equation alphaEquation; // construction BlendMode(); BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation = Equation::Add); BlendMode(Factor colorSourceFactor, Factor colorDestinationFactor, Equation colorBlendEquation, Factor alphaSourceFactor, Factor alphaDestinationFactor, Equation alphaBlendEquation); // methods static constexpr BlendMode Alpha(); static constexpr BlendMode Add(); static constexpr BlendMode Multiply(); static constexpr BlendMode None(); static std::string equationToString(const Equation& eq); static std::string factorToString(const Factor& fc); static void setMode(const BlendMode& mode, bool force = false); static BlendMode getPreBlendFunc(); std::string toString() const; };
Detailed Documentation¶
Fields¶
Factor colorDstFactor
Source blending factor for the color channels.
Equation colorEquation
Destination blending factor for the color channels.
Factor alphaSrcFactor
Blending equation for the color channels.
Factor alphaDstFactor
Source blending factor for the alpha channel.
Equation alphaEquation
Destination blending factor for the alpha channel.
Methods¶
static constexpr BlendMode Alpha()
Blend source and dest according to dest alpha.
static constexpr BlendMode Add()
Add source to dest.
static constexpr BlendMode Multiply()
Multiply source and dest.
static constexpr BlendMode None()
Overwrite dest with source.
static void setMode(const BlendMode& mode, bool force = false)
Set a Predefined Blend Function
Parameters:
mode |
The Blend Mode |
force |
If force to apply the blend ( no matters if the last blend was the same blend ) |
static BlendMode getPreBlendFunc()
Returns:
The last used predefined blend func
std::string toString() const
Blending equation for the alpha channel.