# 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_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
    00134             {
    00135                 OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
    00136                 OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
    00137                 pRep = static_cast<Compositor*>(r.getPointer());
    00138                 pUseCount = r.useCountPointer();
    00139                 if (pUseCount)
    00140                 {
    00141                     ++(*pUseCount);
    00142                 }
    00143             }
    00144         }
    00145
    00147         CompositorPtr& operator=(const ResourcePtr& r)
    00148         {
    00149             if (pRep == static_cast<Compositor*>(r.getPointer()))
    00150                 return *this;
    00151             release();
    00152             // lock & copy other mutex pointer
    00153             OGRE_MUTEX_CONDITIONAL(r.OGRE_AUTO_MUTEX_NAME)
    00154             {
    00155                 OGRE_LOCK_MUTEX(*r.OGRE_AUTO_MUTEX_NAME)
    00156                 OGRE_COPY_AUTO_SHARED_MUTEX(r.OGRE_AUTO_MUTEX_NAME)
    00157                 pRep = static_cast<Compositor*>(r.getPointer());
    00158                 pUseCount = r.useCountPointer();
    00159                 if (pUseCount)
    00160                 {
    00161                     ++(*pUseCount);
    00162                 }
    00163             }
    00164             return *this;
    00165         }
    00166     };
    00167 }
    00168
    00169 #endif

Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Sep 17 15:39:07 2006