# OgreShadowTextureManager.h

Go to the documentation of this file.

    00001 /*-------------------------------------------------------------------------
    00002 This source file is a part of OGRE
    00003 (Object-oriented Graphics Rendering Engine)
    00004
    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 library is free software; you can redistribute it and/or modify it
    00011 under the terms of the GNU Lesser General Public License (LGPL) as
    00012 published by the Free Software Foundation; either version 2.1 of the
    00013 License, or (at your option) any later version.
    00014
    00015 This library is distributed in the hope that it will be useful, but
    00016 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00017 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
    00018 License for more details.
    00019
    00020 You should have received a copy of the GNU Lesser General Public License
    00021 along with this library; if not, write to the Free Software Foundation,
    00022 Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA or go to
    00023 http://www.gnu.org/copyleft/lesser.txt
    00024
    00025 You may alternatively use this source under the terms of a specific version of
    00026 the OGRE Unrestricted License provided you have obtained such a license from
    00027 Torus Knot Software Ltd.
    00028 -------------------------------------------------------------------------*/
    00029 #ifndef __ShadowTextureManager_H__
    00030 #define __ShadowTextureManager_H__
    00031
    00032 // Precompiler options
    00033 #include "OgrePrerequisites.h"
    00034 #include "OgreSingleton.h"
    00035 #include "OgrePixelFormat.h"
    00036 #include "OgreTexture.h"
    00037 #include "OgreIteratorWrappers.h"
    00038
    00039
    00040 namespace Ogre
    00041 {
    00042     typedef std::vector<TexturePtr> ShadowTextureList;
    00043
    00045     struct ShadowTextureConfig
    00046     {
    00047         unsigned int width;
    00048         unsigned int height;
    00049         PixelFormat format;
    00050
    00051         ShadowTextureConfig()
    00052             : width(512), height(512), format(PF_X8R8G8B8) {}
    00053     };
    00054
    00055     typedef std::vector<ShadowTextureConfig> ShadowTextureConfigList;
    00056     typedef ConstVectorIterator<ShadowTextureConfigList> ConstShadowTextureConfigIterator;
    00057
    00058     inline _OgreExport bool operator== ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs );
    00059     inline _OgreExport bool operator!= ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs );
    00060
    00061
    00072     class _OgreExport ShadowTextureManager : public Singleton<ShadowTextureManager>, public ShadowDataAlloc
    00073     {
    00074     protected:
    00075         ShadowTextureList mTextureList;
    00076         ShadowTextureList mNullTextureList;
    00077         size_t mCount;
    00078
    00079     public:
    00080         ShadowTextureManager();
    00081         virtual ~ShadowTextureManager();
    00082
    00086         virtual void getShadowTextures(const ShadowTextureConfigList& config,
    00087             ShadowTextureList& listToPopulate);
    00088
    00092         virtual TexturePtr getNullShadowTexture(PixelFormat format);
    00093
    00099         virtual void clearUnused();
    00104         virtual void clear();
    00105
    00121         static ShadowTextureManager& getSingleton(void);
    00137         static ShadowTextureManager* getSingletonPtr(void);
    00138
    00139     };
    00140
    00141 }
    00142
    00143
    00144 #endif
    00145

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:46:43 2009