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

OgreCompositionTechnique.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 (c) 2000-2005 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 __CompositionTechnique_H__
00026 #define __CompositionTechnique_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgrePixelFormat.h"
00030 #include "OgreIteratorWrappers.h"
00031 
00032 namespace Ogre {
00035     class _OgreExport CompositionTechnique
00036     {
00037     public:
00038         CompositionTechnique(Compositor *parent);
00039         virtual ~CompositionTechnique();
00040     
00042         class TextureDefinition
00043         {
00044         public:
00045             String name;
00046             size_t width;       // 0 means adapt to target width
00047             size_t height;      // 0 means adapt to target height
00048             PixelFormat format;
00049 
00050             TextureDefinition() :width(0), height(0), format(PF_R8G8B8A8){}
00051         };
00053         typedef std::vector<CompositionTargetPass *> TargetPasses;
00054         typedef VectorIterator<TargetPasses> TargetPassIterator;
00055         typedef std::vector<TextureDefinition*> TextureDefinitions;
00056         typedef VectorIterator<TextureDefinitions> TextureDefinitionIterator;
00057         
00061         TextureDefinition *createTextureDefinition(const String &name);
00062         
00065         void removeTextureDefinition(size_t idx);
00066         
00069         TextureDefinition *getTextureDefinition(size_t idx);
00070         
00073         size_t getNumTextureDefinitions();
00074         
00077         void removeAllTextureDefinitions();
00078         
00080         TextureDefinitionIterator getTextureDefinitionIterator(void);
00081         
00084         CompositionTargetPass *createTargetPass();
00085         
00088         void removeTargetPass(size_t idx);
00089         
00092         CompositionTargetPass *getTargetPass(size_t idx);
00093         
00096         size_t getNumTargetPasses();
00097         
00100         void removeAllTargetPasses();
00101         
00103         TargetPassIterator getTargetPassIterator(void);
00104         
00107         CompositionTargetPass *getOutputTargetPass();
00108         
00112         virtual bool isSupported(bool allowTextureDegradation);
00113         
00116         virtual CompositorInstance *createInstance(CompositorChain *chain);
00117         
00120         virtual void destroyInstance(CompositorInstance *instance);
00121         
00123         Compositor *getParent();
00124     private:
00126         Compositor *mParent;
00128         TextureDefinitions mTextureDefinitions;
00129         
00131         TargetPasses mTargetPasses;
00133         CompositionTargetPass *mOutputTarget;    
00134 
00136         typedef std::vector<CompositorInstance *> Instances;
00137         Instances mInstances;
00138     };
00139 
00140 }
00141 
00142 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:38 2006