OgreCompositorManager.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-2006 Torus Knot Software Ltd
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 You may alternatively use this source under the terms of a specific version of
00025 the OGRE Unrestricted License provided you have obtained such a license from
00026 Torus Knot Software Ltd.
00027 -----------------------------------------------------------------------------
00028 */
00029 #ifndef __CompositorManager_H__
00030 #define __CompositorManager_H__
00031 
00032 #include "OgrePrerequisites.h"
00033 #include "OgreResourceManager.h"
00034 #include "OgreCompositor.h"
00035 #include "OgreRectangle2D.h"
00036 #include "OgreCompositorSerializer.h"
00037 #include "OgreRenderSystem.h"
00038 
00039 #if OGRE_THREAD_SUPPORT
00040 // boost::thread_specific_ptr has 'new' in header but delete in lib
00041 // so if we use our memory manager it reports leaks incorrectly
00042 #   include "OgreNoMemoryMacros.h"
00043 #   include <boost/thread/tss.hpp>
00044 #   include "OgreMemoryMacros.h"
00045 #endif
00046 
00047 namespace Ogre {
00061     class _OgreExport CompositorManager : public ResourceManager, public Singleton<CompositorManager>
00062     {
00063     public:
00064         CompositorManager();
00065         virtual ~CompositorManager();
00066 
00068         Resource* createImpl(const String& name, ResourceHandle handle,
00069             const String& group, bool isManual, ManualResourceLoader* loader,
00070             const NameValuePairList* params);
00071 
00074         void initialise(void);
00075 
00078         void parseScript(DataStreamPtr& stream, const String& groupName);
00079 
00085         CompositorChain *getCompositorChain(Viewport *vp);
00086 
00089         bool hasCompositorChain(Viewport *vp) const;
00090 
00093         void removeCompositorChain(Viewport *vp);
00094 
00102         CompositorInstance *addCompositor(Viewport *vp, const String &compositor, int addPosition=-1);
00103 
00106         void removeCompositor(Viewport *vp, const String &compositor);
00107 
00113         void setCompositorEnabled(Viewport *vp, const String &compositor, bool value);
00114 
00117         Renderable *_getTexturedRectangle2D();
00118 
00120         void removeAll(void);
00121 
00123         void _reconstructAllCompositorResources();
00124 
00140         static CompositorManager& getSingleton(void);
00156         static CompositorManager* getSingletonPtr(void);
00157 
00158     
00159     private:
00160         typedef std::map<Viewport*, CompositorChain*> Chains;
00161         Chains mChains;
00162 
00164         OGRE_THREAD_POINTER(CompositorSerializer, mSerializer);
00165 
00168         void freeChains();
00169 
00170         Rectangle2D *mRectangle;
00171     };
00172 }
00173 
00174 #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 Sat May 10 16:24:57 2008