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

OgreCompositor.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 __Compositor_H__
00026 #define __Compositor_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 #include "OgreIteratorWrappers.h"
00030 #include "OgreResource.h"
00031 
00032 namespace Ogre {
00039     class _OgreExport Compositor: public Resource
00040     {
00041     public:
00042         Compositor(ResourceManager* creator, const String& name, ResourceHandle handle,
00043             const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
00044         ~Compositor();
00045         
00047         typedef std::vector<CompositionTechnique *> Techniques;
00048         typedef VectorIterator<Techniques> TechniqueIterator;
00049         
00052         CompositionTechnique *createTechnique();
00053         
00056         void removeTechnique(size_t idx);
00057         
00060         CompositionTechnique *getTechnique(size_t idx);
00061         
00064         size_t getNumTechniques();
00065         
00068         void removeAllTechniques();
00069         
00071         TechniqueIterator getTechniqueIterator(void);
00072         
00079         CompositionTechnique *getSupportedTechnique(size_t idx);
00080         
00087         size_t getNumSupportedTechniques();
00088         
00095         TechniqueIterator getSupportedTechniqueIterator(void);
00096     protected:
00098         void loadImpl(void);
00099 
00101         void unloadImpl(void);
00103         size_t calculateSize(void) const;
00104         
00107         void compile();
00108     private:
00109         Techniques mTechniques;
00110         Techniques mSupportedTechniques;
00111         
00115         bool mCompilationRequired;
00116     };
00117 
00124     class _OgreExport CompositorPtr : public SharedPtr<Compositor> 
00125     {
00126     public:
00127         CompositorPtr() : SharedPtr<Compositor>() {}
00128         explicit CompositorPtr(Compositor* rep) : SharedPtr<Compositor>(rep) {}
00129         CompositorPtr(const CompositorPtr& r) : SharedPtr<Compositor>(r) {} 
00130         CompositorPtr(const ResourcePtr& r) : SharedPtr<Compositor>()
00131         {
00132             // lock & copy other mutex pointer
00133             OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
00134             OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
00135             pRep = static_cast<Compositor*>(r.getPointer());
00136             pUseCount = r.useCountPointer();
00137             if (pUseCount)
00138             {
00139                 ++(*pUseCount);
00140             }
00141         }
00142 
00144         CompositorPtr& operator=(const ResourcePtr& r)
00145         {
00146             if (pRep == static_cast<Compositor*>(r.getPointer()))
00147                 return *this;
00148             release();
00149             // lock & copy other mutex pointer
00150             OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
00151             OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
00152             pRep = static_cast<Compositor*>(r.getPointer());
00153             pUseCount = r.useCountPointer();
00154             if (pUseCount)
00155             {
00156                 ++(*pUseCount);
00157             }
00158             return *this;
00159         }
00160     };
00161 }
00162 
00163 #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