blend_mode.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Harry Storbacka
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 

Generated on Thu Dec 3 02:39:28 2009 for ClanLib by  doxygen 1.4.6