]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/blend.cpp
Use default member initializers for simple types
[libs/gl.git] / source / core / blend.cpp
index 8ceb23829a76894e978dfad03a1531c3421c215e..99ffcd075c933a4441a8535dfed14b735a09acb4 100644 (file)
@@ -1,5 +1,3 @@
-#include <msp/gl/extensions/ext_blend_minmax.h>
-#include <msp/gl/extensions/ext_blend_subtract.h>
 #include <msp/strings/format.h>
 #include <msp/strings/utils.h>
 #include "blend.h"
@@ -9,31 +7,17 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-Blend::Blend():
-       enabled(false),
-       equation(ADD),
-       src_factor(ONE),
-       dst_factor(ZERO),
-       constant(0.0f, 0.0f, 0.0f, 0.0f),
-       write_mask(WRITE_ALL)
-{ }
-
 Blend::Blend(BlendFactor sf, BlendFactor df):
        enabled(true),
-       equation(ADD),
        src_factor(sf),
-       dst_factor(df),
-       constant(0.0f, 0.0f, 0.0f, 0.0f),
-       write_mask(WRITE_ALL)
+       dst_factor(df)
 { }
 
 Blend::Blend(BlendEquation e, BlendFactor sf, BlendFactor df):
        enabled(true),
        equation(e),
        src_factor(sf),
-       dst_factor(df),
-       constant(0.0f, 0.0f, 0.0f, 0.0f),
-       write_mask(WRITE_ALL)
+       dst_factor(df)
 { }
 
 
@@ -64,41 +48,6 @@ void Blend::Loader::factors(BlendFactor sf, BlendFactor df)
 }
 
 
-unsigned get_gl_blend_equation(BlendEquation eq)
-{
-       switch(eq)
-       {
-       case ADD: return GL_FUNC_ADD;
-       case SUBTRACT: return GL_FUNC_SUBTRACT;
-       case REVERSE_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT;
-       case MIN: return GL_MIN;
-       case MAX: return GL_MAX;
-       default: throw invalid_argument("get_gl_blend_equation");
-       }
-}
-
-unsigned get_gl_blend_factor(BlendFactor factor)
-{
-       switch(factor)
-       {
-       case ZERO: return GL_ZERO;
-       case ONE: return GL_ONE;
-       case SRC_COLOR: return GL_SRC_COLOR;
-       case ONE_MINUS_SRC_COLOR: return GL_ONE_MINUS_SRC_COLOR;
-       case SRC_ALPHA: return GL_SRC_ALPHA;
-       case ONE_MINUS_SRC_ALPHA: return GL_ONE_MINUS_SRC_ALPHA;
-       case DST_COLOR: return GL_DST_COLOR;
-       case ONE_MINUS_DST_COLOR: return GL_ONE_MINUS_DST_COLOR;
-       case DST_ALPHA: return GL_DST_ALPHA;
-       case ONE_MINUS_DST_ALPHA: return GL_ONE_MINUS_DST_ALPHA;
-       case CONSTANT_COLOR: return GL_CONSTANT_COLOR;
-       case ONE_MINUS_CONSTANT_COLOR: return GL_ONE_MINUS_CONSTANT_COLOR;
-       case CONSTANT_ALPHA: return GL_CONSTANT_ALPHA;
-       case ONE_MINUS_CONSTANT_ALPHA: return GL_ONE_MINUS_CONSTANT_ALPHA;
-       default: throw invalid_argument("get_gl_blend_factor");
-       }
-}
-
 void operator>>(const LexicalConverter &conv, BlendEquation &eq)
 {
        const string &str = conv.get();