X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fblend.cpp;h=3327885c74c1ef34b7a5c1d111f22935a8639de0;hb=HEAD;hp=8b82772fded1e7fc6acc755c312964ac867a0b3b;hpb=f17794d55923d4fb4f63e9d082d8d84a735a04e8;p=libs%2Fgl.git diff --git a/source/blend.cpp b/source/blend.cpp deleted file mode 100644 index 8b82772f..00000000 --- a/source/blend.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2008, 2010 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - -#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); - // XXX Don't try to set equation if version < 1.2 - glBlendEquation(eq); - glBlendFunc(src_factor, dst_factor); - } -} - -const Blend &Blend::alpha() -{ - static Blend blend(SRC_ALPHA, ONE_MINUS_SRC_ALPHA); - return blend; -} - -void Blend::unbind() -{ - if(set_current(0)) - glDisable(GL_BLEND); -} - - -void blend_equation(BlendEquation eq) -{ - static RequireVersion _ver(1, 2); - glBlendEquation(eq); -} - -void blend_func(BlendFactor src, BlendFactor dst) -{ - glBlendFunc(src, dst); -} - -} // namespace GL -} // namespace Msp