X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fblend.cpp;h=3327885c74c1ef34b7a5c1d111f22935a8639de0;hp=03fc0f02baf32c917e1be36ad9ec33f7237f9233;hb=HEAD;hpb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8 diff --git a/source/blend.cpp b/source/blend.cpp deleted file mode 100644 index 03fc0f02..00000000 --- a/source/blend.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "blend.h" -#include "extension.h" -#include "version_1_2.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!=ADD) - static RequireVersion _ver(1, 2); -} - -void Blend::bind() const -{ - if(set_current(this)) - { - glEnable(GL_BLEND); - if(glBlendEquation) - 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