Go to the documentation of this file.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 };
00102
00106 class CL_API_DISPLAY CL_BlendMode
00107 {
00110
00111 public:
00112 CL_BlendMode();
00113
00114 ~CL_BlendMode();
00115
00119
00120 public:
00122 const CL_Colorf &get_blend_color() const;
00123
00125 CL_BlendEquation get_blend_equation() const;
00126
00128 CL_BlendEquation get_blend_equation_alpha() const;
00129
00131 CL_BlendFunc get_blend_function_src() const;
00132
00134 CL_BlendFunc get_blend_function_dest() const;
00135
00137 CL_BlendFunc get_blend_function_src_alpha() const;
00138
00140 CL_BlendFunc get_blend_function_dest_alpha() const;
00141
00143 bool is_blend_enabled() const;
00144
00148
00149 public:
00151 bool operator ==(const CL_BlendMode &other) const;
00152
00154 void enable_blending(bool value);
00155
00157 void set_blend_color(const CL_Colorf &color);
00158
00160 void set_blend_equation(CL_BlendEquation color, CL_BlendEquation alpha);
00161
00163 void set_blend_function(CL_BlendFunc src, CL_BlendFunc dest, CL_BlendFunc src_alpha, CL_BlendFunc dest_alpha);
00164
00168
00169 private:
00170 CL_SharedPtr<CL_BlendMode_Impl> impl;
00172 };
00173