3 This file is part of libmspgl
4 Copyright © 2008, 2010 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_BLEND_H_
9 #define MSP_GL_BLEND_H_
25 SUBTRACT = GL_FUNC_SUBTRACT,
26 REVERSE_SUBTRACT = GL_FUNC_REVERSE_SUBTRACT,
35 SRC_COLOR = GL_SRC_COLOR,
36 ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR,
37 SRC_ALPHA = GL_SRC_ALPHA,
38 ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA,
39 DST_COLOR = GL_DST_COLOR,
40 ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR,
41 DST_ALPHA = GL_DST_ALPHA,
42 ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA,
43 CONSTANT_COLOR = GL_CONSTANT_COLOR,
44 ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR,
45 CONSTANT_ALPHA = GL_CONSTANT_ALPHA,
46 ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA
50 Blends incoming fragments with those already in the framebuffer.
52 class Blend: public Bindable<Blend>
56 BlendFactor src_factor;
57 BlendFactor dst_factor;
61 Blend(BlendFactor, BlendFactor);
62 Blend(BlendEquation, BlendFactor, BlendFactor);
66 static const Blend &alpha();
70 void blend_equation(BlendEquation eq);
71 void blend_func(BlendFactor src, BlendFactor dst);