OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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-2011 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 "OgreTexture.h"
38 #include "OgreIteratorWrappers.h"
39 
40 
41 namespace Ogre
42 {
50 
53  {
54  unsigned int width;
55  unsigned int height;
57 
59  : width(512), height(512), format(PF_X8R8G8B8) {}
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 
99  virtual TexturePtr getNullShadowTexture(PixelFormat format);
100 
106  virtual void clearUnused();
111  virtual void clear();
112 
128  static ShadowTextureManager& getSingleton(void);
144  static ShadowTextureManager* getSingletonPtr(void);
145 
146  };
147 
150 }
151 
152 
153 #endif
154 
#define _OgreExport
Definition: OgrePlatform.h:203
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...
Specialisation of SharedPtr to allow SharedPtr to be assigned to TexturePtr.
Definition: OgreTexture.h:440
vector< ShadowTextureConfig >::type ShadowTextureConfigList
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++)