00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00031
00032 #pragma once
00033
00034 #include "../api_display.h"
00035 #include "../../Core/System/sharedptr.h"
00036
00037 class CL_Colorf;
00038 class CL_BlendMode_Impl;
00039
00043 enum CL_BlendFunc
00044 {
00046 cl_blend_zero,
00047
00049 cl_blend_one,
00050
00052 cl_blend_dest_color,
00053
00055 cl_blend_src_color,
00056
00058 cl_blend_one_minus_dest_color,
00059
00061 cl_blend_one_minus_src_color,
00062
00064 cl_blend_src_alpha,
00065
00067 cl_blend_one_minus_src_alpha,
00068
00070 cl_blend_dest_alpha,
00071
00073 cl_blend_one_minus_dest_alpha,
00074
00076 cl_blend_src_alpha_saturate,
00077
00079 cl_blend_constant_color,
00080
00082 cl_blend_one_minus_constant_color,
00083
00085 cl_blend_constant_alpha,
00086
00088 cl_blend_one_minus_constant_alpha
00089 };
00090
00094 enum CL_BlendEquation
00095 {
00096 cl_blend_equation_add,
00097 cl_blend_equation_subtract,
00098 cl_blend_equation_reverse_subtract,
00099 cl_blend_equation_min,
00100 cl_blend_equation_max,
00101 cl_blend_equation_logic_op
00102 };
00103
00107 class CL_API_DISPLAY CL_BlendMode
00108 {
00111
00112 public:
00113 CL_BlendMode();
00114
00115 ~CL_BlendMode();
00116
00120
00121 public:
00123 const CL_Colorf &get_blend_color() const;
00124
00126 CL_BlendEquation get_blend_equation() const;
00127
00129 CL_BlendEquation get_blend_equation_alpha() const;
00130
00132 CL_BlendFunc get_blend_function_src() const;
00133
00135 CL_BlendFunc get_blend_function_dest() const;
00136
00138 CL_BlendFunc get_blend_function_src_alpha() const;
00139
00141 CL_BlendFunc get_blend_function_dest_alpha() const;
00142
00144 bool is_blend_enabled() const;
00145
00149
00150 public:
00152 bool operator ==(const CL_BlendMode &other) const;
00153
00155 void enable_blending(bool value);
00156
00158 void set_blend_color(const CL_Colorf &color);
00159
00161 void set_blend_equation(CL_BlendEquation color, CL_BlendEquation alpha);
00162
00164 void set_blend_function(CL_BlendFunc src, CL_BlendFunc dest, CL_BlendFunc src_alpha, CL_BlendFunc dest_alpha);
00165
00169
00170 private:
00171 CL_SharedPtr<CL_BlendMode_Impl> impl;
00173 };
00174