Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreBlendMode.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __BLENDMODE_H__
00026 #define __BLENDMODE_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 namespace Ogre {
00031 
00034     enum LayerBlendType
00035     {
00036         LBT_COLOUR,
00037         LBT_ALPHA
00038     };
00039 
00047     enum LayerBlendOperation {
00049         LBO_REPLACE,
00051         LBO_ADD,
00053         LBO_MODULATE,
00055         LBO_ALPHA_BLEND
00056 
00057     };
00058 
00065     enum LayerBlendOperationEx {
00067         LBX_SOURCE1,
00069         LBX_SOURCE2,
00071         LBX_MODULATE,
00073         LBX_MODULATE_X2,
00075         LBX_MODULATE_X4,
00077         LBX_ADD,
00079         LBX_ADD_SIGNED,
00081         LBX_ADD_SMOOTH,
00083         LBX_SUBTRACT,
00085         LBX_BLEND_DIFFUSE_ALPHA,
00087         LBX_BLEND_TEXTURE_ALPHA,
00089         LBX_BLEND_CURRENT_ALPHA,
00091         LBX_BLEND_MANUAL
00092     };
00093 
00098     enum LayerBlendSource
00099     {
00101         LBS_CURRENT,
00103         LBS_TEXTURE,
00105         LBS_DIFFUSE,
00107         LBS_SPECULAR,
00109         LBS_MANUAL
00110     };
00125     class _OgreExport LayerBlendModeEx
00126     {
00127     public:
00129         LayerBlendType blendType;
00131         LayerBlendOperationEx operation;
00133         LayerBlendSource source1;
00135         LayerBlendSource source2;
00136 
00138         ColourValue colourArg1;
00140         ColourValue colourArg2;
00142         Real alphaArg1;
00144         Real alphaArg2;
00146         Real factor;
00147 
00148         bool operator==(const LayerBlendModeEx& rhs) const
00149         {
00150             if (blendType != rhs.blendType) return false;
00151 
00152             if (blendType == LBT_COLOUR)
00153             {
00154 
00155                 if (operation == rhs.operation &&
00156                     source1 == rhs.source1 &&
00157                     source2 == rhs.source2 &&
00158                     colourArg1 == rhs.colourArg1 &&
00159                     colourArg2 == rhs.colourArg2 &&
00160                     factor == rhs.factor)
00161                 {
00162                     return true;
00163                 }
00164             }
00165             else // if (blendType == LBT_ALPHA)
00166             {
00167                 if (operation == rhs.operation &&
00168                     source1 == rhs.source1 &&
00169                     source2 == rhs.source2 &&
00170                     alphaArg1 == rhs.alphaArg1 &&
00171                     alphaArg2 == rhs.alphaArg2 &&
00172                     factor == rhs.factor)
00173                 {
00174                     return true;
00175                 }
00176             }
00177             return false;
00178         }
00179 
00180         bool operator!=(const LayerBlendModeEx& rhs) const
00181         {
00182             return !(*this == rhs);
00183         }
00184 
00185 
00186 
00187     };
00188 
00201     enum SceneBlendType
00202     {
00204         SBT_TRANSPARENT_ALPHA,
00206         SBT_TRANSPARENT_COLOUR,
00208         SBT_ADD
00209         // TODO : more
00210     };
00211 
00216     enum SceneBlendFactor
00217     {
00218         SBF_ONE,
00219         SBF_ZERO,
00220         SBF_DEST_COLOUR,
00221         SBF_SOURCE_COLOUR,
00222         SBF_ONE_MINUS_DEST_COLOUR,
00223         SBF_ONE_MINUS_SOURCE_COLOUR,
00224         SBF_DEST_ALPHA,
00225         SBF_SOURCE_ALPHA,
00226         SBF_ONE_MINUS_DEST_ALPHA,
00227         SBF_ONE_MINUS_SOURCE_ALPHA
00228 
00229     };
00230 }
00231 
00232 #endif

Copyright © 2002 by The OGRE Team