X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fblend.cpp;h=3327885c74c1ef34b7a5c1d111f22935a8639de0;hb=HEAD;hp=184d5ad534f1aca6bcf441726b54e8c80af94a1b;hpb=06a3ecb3aaf9142fe9f5300b417f4b73e888050e;p=libs%2Fgl.git diff --git a/source/blend.cpp b/source/blend.cpp deleted file mode 100644 index 184d5ad5..00000000 --- a/source/blend.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include -#include "blend.h" - -namespace Msp { -namespace GL { - -Blend::Blend(): - eq(ADD), - src_factor(ONE), - dst_factor(ZERO) -{ } - -Blend::Blend(BlendFactor sf, BlendFactor df): - eq(ADD), - src_factor(sf), - dst_factor(df) -{ } - -Blend::Blend(BlendEquation e, BlendFactor sf, BlendFactor df): - eq(e), - src_factor(sf), - dst_factor(df) -{ - if(eq==MIN || eq==MAX) - static Require _req(EXT_blend_minmax); - else if(eq==SUBTRACT || eq==REVERSE_SUBTRACT) - static Require _req(EXT_blend_subtract); -} - -void Blend::bind() const -{ - if(set_current(this)) - { - glEnable(GL_BLEND); - if(EXT_blend_minmax) - glBlendEquation(eq); - glBlendFunc(src_factor, dst_factor); - } -} - -void Blend::unbind() -{ - if(set_current(0)) - glDisable(GL_BLEND); -} - -const Blend &Blend::alpha() -{ - static Blend blend(SRC_ALPHA, ONE_MINUS_SRC_ALPHA); - return blend; -} - -} // namespace GL -} // namespace Msp