OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreShadowTextureManager.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2 This source file is a part of OGRE
3 (Object-oriented Graphics Rendering Engine)
4 
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE
25 
26 You may alternatively use this source under the terms of a specific version of
27 the OGRE Unrestricted License provided you have obtained such a license from
28 Torus Knot Software Ltd.
29 -------------------------------------------------------------------------*/
30 #ifndef __ShadowTextureManager_H__
31 #define __ShadowTextureManager_H__
32 
33 // Precompiler options
34 #include "OgrePrerequisites.h"
35 #include "OgreSingleton.h"
36 #include "OgrePixelFormat.h"
37 #include "OgreHeaderPrefix.h"
38 
39 namespace Ogre
40 {
48 
51  {
52  unsigned int width;
53  unsigned int height;
55  unsigned int fsaa;
57 
59  : width(512), height(512), format(PF_X8R8G8B8), fsaa(0), depthBufferPoolId(1) {}
60  };
61 
64 
65  inline _OgreExport bool operator== ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs );
66  inline _OgreExport bool operator!= ( const ShadowTextureConfig& lhs, const ShadowTextureConfig& rhs );
67 
68 
79  class _OgreExport ShadowTextureManager : public Singleton<ShadowTextureManager>, public ShadowDataAlloc
80  {
81  protected:
84  size_t mCount;
85 
86  public:
88  virtual ~ShadowTextureManager();
89 
93  virtual void getShadowTextures(const ShadowTextureConfigList& config,
94  ShadowTextureList& listToPopulate);
95 
98  virtual void getAllShadowTextures(ShadowTextureList& listToPopulate) { listToPopulate = mTextureList; }
99 
103  virtual TexturePtr getNullShadowTexture(PixelFormat format);
104 
110  virtual void clearUnused();
115  virtual void clear();
116 
132  static ShadowTextureManager& getSingleton(void);
148  static ShadowTextureManager* getSingletonPtr(void);
149 
150  };
151 
154 }
155 
156 #include "OgreHeaderSuffix.h"
157 
158 #endif
159 
#define _OgreExport
Definition: OgrePlatform.h:255
std::vector< T, A > type
ConstVectorIterator< ShadowTextureConfigList > ConstShadowTextureConfigIterator
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
vector< TexturePtr >::type ShadowTextureList
Class to manage the available shadow textures which may be shared between many SceneManager instances...
PixelFormat
The pixel format used for images, textures, and render surfaces.
Structure containing the configuration for one shadow texture.
32-bit pixel format, 8 bits for red, 8 bits for green, 8 bits for blue like PF_A8R8G8B8, but alpha will get discarded
Concrete IteratorWrapper for const access to the underlying container.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual void getAllShadowTextures(ShadowTextureList &listToPopulate)
Populate an incoming list with all shadow texture references.
vector< ShadowTextureConfig >::type ShadowTextureConfigList
unsigned short uint16
Definition: OgrePlatform.h:421
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator, (ISO C++)