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

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 
00038 #if OGRE_THREAD_SUPPORT
00039 // boost::thread_specific_ptr has 'new' in header but delete in lib
00040 // so if we use our memory manager it reports leaks incorrectly
00041 #   include "OgreNoMemoryMacros.h"
00042 #   include <boost/thread/tss.hpp>
00043 #   include "OgreMemoryMacros.h"
00044 #endif
00045 
00046 namespace Ogre {
00060     class _OgreExport CompositorManager : public ResourceManager, public Singleton<CompositorManager>
00061     {
00062     public:
00063         CompositorManager();
00064         virtual ~CompositorManager();
00065 
00067         Resource* createImpl(const String& name, ResourceHandle handle,
00068             const String& group, bool isManual, ManualResourceLoader* loader,
00069             const NameValuePairList* params);
00070 
00073         void initialise(void);
00074 
00077         void parseScript(DataStreamPtr& stream, const String& groupName);
00078 
00084         CompositorChain *getCompositorChain(Viewport *vp);
00085 
00088         bool hasCompositorChain(Viewport *vp) const;
00089 
00092         void removeCompositorChain(Viewport *vp);
00093 
00101         CompositorInstance *addCompositor(Viewport *vp, const String &compositor, int addPosition=-1);
00102 
00105         void removeCompositor(Viewport *vp, const String &compositor);
00106 
00112         void setCompositorEnabled(Viewport *vp, const String &compositor, bool value);
00113 
00116         Renderable *_getTexturedRectangle2D();
00117 
00119         void removeAll(void);
00120 
00136         static CompositorManager& getSingleton(void);
00152         static CompositorManager* getSingletonPtr(void);
00153 
00154     
00155     private:
00156         typedef std::map<Viewport*, CompositorChain*> Chains;
00157         Chains mChains;
00158 
00160         OGRE_THREAD_POINTER(CompositorSerializer, mSerializer);
00161 
00164         void freeChains();
00165 
00166         Rectangle2D *mRectangle;
00167     };
00168 }
00169 
00170 #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 Jun 10 10:35:47 2007