2 #include <msp/gl/extensions/ext_blend_minmax.h>
3 #include <msp/gl/extensions/ext_blend_subtract.h>
5 #include "blend_backend.h"
13 unsigned get_gl_blend_equation(BlendEquation eq)
17 case ADD: return GL_FUNC_ADD;
18 case SUBTRACT: return GL_FUNC_SUBTRACT;
19 case REVERSE_SUBTRACT: return GL_FUNC_REVERSE_SUBTRACT;
20 case MIN: return GL_MIN;
21 case MAX: return GL_MAX;
22 default: throw invalid_argument("get_gl_blend_equation");
26 unsigned get_gl_blend_factor(BlendFactor factor)
30 case ZERO: return GL_ZERO;
31 case ONE: return GL_ONE;
32 case SRC_COLOR: return GL_SRC_COLOR;
33 case ONE_MINUS_SRC_COLOR: return GL_ONE_MINUS_SRC_COLOR;
34 case SRC_ALPHA: return GL_SRC_ALPHA;
35 case ONE_MINUS_SRC_ALPHA: return GL_ONE_MINUS_SRC_ALPHA;
36 case DST_COLOR: return GL_DST_COLOR;
37 case ONE_MINUS_DST_COLOR: return GL_ONE_MINUS_DST_COLOR;
38 case DST_ALPHA: return GL_DST_ALPHA;
39 case ONE_MINUS_DST_ALPHA: return GL_ONE_MINUS_DST_ALPHA;
40 case CONSTANT_COLOR: return GL_CONSTANT_COLOR;
41 case ONE_MINUS_CONSTANT_COLOR: return GL_ONE_MINUS_CONSTANT_COLOR;
42 case CONSTANT_ALPHA: return GL_CONSTANT_ALPHA;
43 case ONE_MINUS_CONSTANT_ALPHA: return GL_ONE_MINUS_CONSTANT_ALPHA;
44 default: throw invalid_argument("get_gl_blend_factor");