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

OgreTechnique.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://www.ogre3d.org/
00006 
00007 Copyright © 2000-2003 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 __Technique_H__
00026 #define __Technique_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgreIteratorWrappers.h"
00030 #include "OgreBlendMode.h"
00031 #include "OgreCommon.h"
00032 
00033 namespace Ogre {
00040     class _OgreExport Technique
00041     {
00042     protected:
00043         typedef std::vector<Pass*> Passes;
00044         Passes mPasses;
00045         Material* mParent;
00046         bool mIsSupported;
00047         unsigned short mLodIndex;
00048     public:
00050         Technique(Material* parent);
00052         Technique(Material* parent, const Technique& oth);
00053         ~Technique();
00059         bool isSupported(void) const;
00061         void _compile(bool autoManageTextureUnits);
00062 
00073         Pass* createPass(void);
00075         Pass* getPass(unsigned short index);
00077         unsigned short getNumPasses(void) const;
00079         void removePass(unsigned short index);
00081         void removeAllPasses(void);
00082         typedef VectorIterator<Passes> PassIterator;
00084         const PassIterator getPassIterator(void);
00086         Material* getParent(void) const { return mParent; }
00087 
00089         Technique& operator=(const Technique& rhs);
00090 
00099         bool isTransparent(void) const;
00100 
00102         void _load(void);
00104         void _unload(void);
00105 
00106         // Is this loaded?
00107         bool isLoaded(void) const;
00108 
00110         void _notifyNeedsRecompile(void);
00111 
00112 
00113         // -------------------------------------------------------------------------------
00114         // The following methods are to make migration from previous versions simpler
00115         // and to make code easier to write when dealing with simple materials
00116         // They set the properties which have been moved to Pass for all Techniques and all Passes
00117 
00126         void setAmbient(Real red, Real green, Real blue);
00127 
00136         void setAmbient(const ColourValue& ambient);
00137 
00146         void setDiffuse(Real red, Real green, Real blue);
00147 
00156         void setDiffuse(const ColourValue& diffuse);
00157 
00166         void setSpecular(Real red, Real green, Real blue);
00167 
00176         void setSpecular(const ColourValue& specular);
00177 
00186         void setShininess(Real val);
00187 
00196         void setSelfIllumination(Real red, Real green, Real blue);
00197 
00206         void setSelfIllumination(const ColourValue& selfIllum);
00207 
00216         void setDepthCheckEnabled(bool enabled);
00217 
00226         void setDepthWriteEnabled(bool enabled);
00227 
00236         void setDepthFunction( CompareFunction func );
00237 
00246         void setColourWriteEnabled(bool enabled);
00247 
00256         void setCullingMode( CullingMode mode );
00257 
00266         void setManualCullingMode( ManualCullingMode mode );
00267 
00276         void setLightingEnabled(bool enabled);
00277 
00286         void setShadingMode( ShadeOptions mode );
00287 
00296         void setFog(
00297             bool overrideScene,
00298             FogMode mode = FOG_NONE,
00299             const ColourValue& colour = ColourValue::White,
00300             Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
00301 
00310         void setDepthBias(ushort bias);
00311 
00320         void setTextureFiltering(TextureFilterOptions filterType);
00329         void setTextureAnisotropy(unsigned int maxAniso);
00330 
00339         void setSceneBlending( const SceneBlendType sbt );
00340 
00349         void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
00350 
00367         void setLodIndex(unsigned short index);
00369         unsigned short getLodIndex(void) const { return mLodIndex; }
00370 
00371 
00372     };
00373 
00374 
00375 }
00376 #endif

Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:29 2004