OGLplus (0.52.0) a C++ wrapper for OpenGL

blending.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef OGLPLUS_CONTEXT_BLENDING_1201040722_HPP
14 #define OGLPLUS_CONTEXT_BLENDING_1201040722_HPP
15 
16 #include <oglplus/glfunc.hpp>
18 
19 namespace oglplus {
20 namespace context {
21 
23 
26 class Blending
27 {
28 public:
29 
30 #if OGLPLUS_DOCUMENTATION_ONLY || GL_KHR_blend_equation_advanced
31 
36  static void BlendBarrier(void)
37  {
38  OGLPLUS_GLFUNC(BlendBarrierKHR)();
39  OGLPLUS_VERIFY_SIMPLE(BlendBarrierKHR);
40  }
41 #endif
42 
44 
48  static void BlendEquation(
49  OneOf<
50  GLenum,
51  std::tuple<
54  >
55  > eq
56  )
57  {
58  OGLPLUS_GLFUNC(BlendEquation)(GLenum(eq));
59  OGLPLUS_VERIFY_SIMPLE(BlendEquation);
60  }
61 
63 
67  static void BlendEquationSeparate(
69  oglplus::BlendEquation eq_alpha
70  )
71  {
72  OGLPLUS_GLFUNC(BlendEquationSeparate)(
73  GLenum(eq_rgb),
74  GLenum(eq_alpha)
75  );
76  OGLPLUS_VERIFY_SIMPLE(BlendEquationSeparate);
77  }
78 
79 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_0
80 
86  static void BlendEquation(
87  GLuint buffer,
88  OneOf<
89  GLenum,
90  std::tuple<
93  >
94  > eq
95  )
96  {
97  OGLPLUS_GLFUNC(BlendEquationi)(buffer, GLenum(eq));
98  OGLPLUS_VERIFY(
99  BlendEquationi,
100  Error,
101  Index(buffer)
102  );
103  }
104 
106 
112  GLuint buffer,
113  oglplus::BlendEquation eq_rgb,
114  oglplus::BlendEquation eq_alpha
115  )
116  {
117  OGLPLUS_GLFUNC(BlendEquationSeparatei)(
118  buffer,
119  GLenum(eq_rgb),
120  GLenum(eq_alpha)
121  );
122  OGLPLUS_VERIFY(
123  BlendEquationSeparatei,
124  Error,
125  Index(buffer)
126  );
127  }
128 #endif
129 
131 
135  static void BlendFunc(BlendFunction src, BlendFunction dst)
136  {
137  OGLPLUS_GLFUNC(BlendFunc)(GLenum(src), GLenum(dst));
138  OGLPLUS_VERIFY_SIMPLE(BlendFunc);
139  }
140 
142 
146  static void BlendFuncSeparate(
147  BlendFunction src_rgb,
148  BlendFunction dst_rgb,
149  BlendFunction src_alpha,
150  BlendFunction dst_alpha
151  )
152  {
153  OGLPLUS_GLFUNC(BlendFuncSeparate)(
154  GLenum(src_rgb),
155  GLenum(dst_rgb),
156  GLenum(src_alpha),
157  GLenum(dst_alpha)
158  );
159  OGLPLUS_VERIFY_SIMPLE(BlendFuncSeparate);
160  }
161 
162 #if OGLPLUS_DOCUMENTATION_ONLY || GL_VERSION_4_0
163 
169  static void BlendFunc(
170  GLuint buffer,
171  BlendFunction src,
172  BlendFunction dst
173  )
174  {
175  OGLPLUS_GLFUNC(BlendFunci)(buffer, GLenum(src), GLenum(dst));
176  OGLPLUS_VERIFY(
177  BlendFunci,
178  Error,
179  Index(buffer)
180  );
181  }
182 
184 
189  static void BlendFuncSeparate(
190  GLuint buffer,
191  BlendFunction src_rgb,
192  BlendFunction dst_rgb,
193  BlendFunction src_alpha,
194  BlendFunction dst_alpha
195  )
196  {
197  OGLPLUS_GLFUNC(BlendFuncSeparatei)(
198  buffer,
199  GLenum(src_rgb),
200  GLenum(dst_rgb),
201  GLenum(src_alpha),
202  GLenum(dst_alpha)
203  );
204  OGLPLUS_VERIFY(
205  BlendFuncSeparatei,
206  Error,
207  Index(buffer)
208  );
209  }
210 #endif
211 
213 
217  static void BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
218  {
219  OGLPLUS_GLFUNC(BlendColor)(r, g, b, a);
220  OGLPLUS_VERIFY_SIMPLE(BlendColor);
221  }
222 };
223 
224 } // namespace context
225 } // namespace oglplus
226 
227 #endif // include guard
Wrapper for blending operations.
Definition: blending.hpp:26
static void BlendEquation(GLuint buffer, OneOf< GLenum, std::tuple< oglplus::BlendEquation, oglplus::BlendEquationAdvanced > > eq)
Sets the blend equation for a particular draw buffer.
Definition: blending.hpp:86
static void BlendFunc(BlendFunction src, BlendFunction dst)
Sets the blend function.
Definition: blending.hpp:135
static void BlendFuncSeparate(GLuint buffer, BlendFunction src_rgb, BlendFunction dst_rgb, BlendFunction src_alpha, BlendFunction dst_alpha)
Sets the blend function separate for RGB and alpha for a buffer.
Definition: blending.hpp:189
static void BlendEquation(OneOf< GLenum, std::tuple< oglplus::BlendEquation, oglplus::BlendEquationAdvanced > > eq)
Sets the blend equation.
Definition: blending.hpp:48
static void BlendEquationSeparate(GLuint buffer, oglplus::BlendEquation eq_rgb, oglplus::BlendEquation eq_alpha)
Sets the blend equation separate for RGB and alpha for a buffer.
Definition: blending.hpp:111
static void BlendFunc(GLuint buffer, BlendFunction src, BlendFunction dst)
Sets the blend function for a particular buffer.
Definition: blending.hpp:169
static void BlendFuncSeparate(BlendFunction src_rgb, BlendFunction dst_rgb, BlendFunction src_alpha, BlendFunction dst_alpha)
Sets the blend function separate for RGB and alpha.
Definition: blending.hpp:146
Helper macro for optional checking of availability of GL function.
BlendEquation
Blend equation enumeration.
Definition: blend_function.hpp:49
BlendFunction
Blend function type enumeration.
Definition: blend_function.hpp:27
Stores a value having one of the listed types in a common representation.
Definition: one_of.hpp:60
static void BlendEquationSeparate(oglplus::BlendEquation eq_rgb, oglplus::BlendEquation eq_alpha)
Sets the blend equation separate for RGB and alpha.
Definition: blending.hpp:67
Exception class for general OpenGL errors.
Definition: basic.hpp:43
OpenGL blending function and equation enumeration.
static void BlendBarrier(void)
Specified boundaries between blending passes.
Definition: blending.hpp:36
static void BlendColor(GLclampf r, GLclampf g, GLclampf b, GLclampf a)
Sets the blend color.
Definition: blending.hpp:217
BlendEquationAdvanced
Advanced blend equation enumeration.
Definition: blend_function.hpp:71

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).