ClanLib  2.3.7
blend_mode.h
Go to the documentation of this file.
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2011 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Harry Storbacka
27 */
28 
31 
32 #pragma once
33 
34 #include "../api_display.h"
35 #include "../../Core/System/sharedptr.h"
36 
37 class CL_Colorf;
38 class CL_BlendMode_Impl;
39 
44 {
47 
50 
53 
56 
59 
62 
65 
68 
71 
74 
77 
80 
83 
86 
89 };
90 
95 {
101 };
102 
107 {
110 
111 public:
112  CL_BlendMode();
113 
114  ~CL_BlendMode();
115 
119 
120 public:
122  const CL_Colorf &get_blend_color() const;
123 
125  CL_BlendEquation get_blend_equation() const;
126 
128  CL_BlendEquation get_blend_equation_alpha() const;
129 
131  CL_BlendFunc get_blend_function_src() const;
132 
134  CL_BlendFunc get_blend_function_dest() const;
135 
137  CL_BlendFunc get_blend_function_src_alpha() const;
138 
140  CL_BlendFunc get_blend_function_dest_alpha() const;
141 
143  bool is_blend_enabled() const;
144 
148 
149 public:
151  bool operator ==(const CL_BlendMode &other) const;
152 
154  void enable_blending(bool value);
155 
157  void set_blend_color(const CL_Colorf &color);
158 
160  void set_blend_equation(CL_BlendEquation color, CL_BlendEquation alpha);
161 
163  void set_blend_function(CL_BlendFunc src, CL_BlendFunc dest, CL_BlendFunc src_alpha, CL_BlendFunc dest_alpha);
164 
168 
169 private:
170  CL_SharedPtr<CL_BlendMode_Impl> impl;
172 };
173