OgreCompositor.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2013 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __Compositor_H__
29 #define __Compositor_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreIteratorWrappers.h"
33 #include "OgreResource.h"
34 #include "OgreTexture.h"
35 #include "OgreHeaderPrefix.h"
36 
37 namespace Ogre {
51  {
52  public:
53  Compositor(ResourceManager* creator, const String& name, ResourceHandle handle,
54  const String& group, bool isManual = false, ManualResourceLoader* loader = 0);
56 
60 
64 
67  void removeTechnique(size_t idx);
68 
72 
75  size_t getNumTechniques();
76 
80 
83 
91 
99 
107 
116 
122  const String& getTextureInstanceName(const String& name, size_t mrtIndex);
123 
129  TexturePtr getTextureInstance(const String& name, size_t mrtIndex);
130 
138 
139  protected:
141  void loadImpl(void);
142 
144  void unloadImpl(void);
146  size_t calculateSize(void) const;
147 
150  void compile();
151  private:
154 
159 
163 
167 
168  //TODO GSOC : These typedefs are duplicated from CompositorInstance. Solve?
175  };
178 }
179 
180 #include "OgreHeaderSuffix.h"
181 
182 #endif
#define _OgreExport
Definition: OgrePlatform.h:257
Base composition technique, can be subclassed in plugins.
Class representing a Compositor object.
Techniques mSupportedTechniques
GlobalMRTMap mGlobalMRTs
map< String, TexturePtr >::type GlobalTextureMap
Map from name->local texture.
GlobalTextureMap mGlobalTextures
Compositor(ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0)
size_t getNumSupportedTechniques()
Get the number of supported techniques.
TechniqueIterator getSupportedTechniqueIterator(void)
Gets an iterator over all the Techniques which are supported by the current card.
void removeAllTechniques()
Remove all techniques.
size_t getNumTechniques()
Get the number of techniques.
TechniqueIterator getTechniqueIterator(void)
Get an iterator over the Techniques in this compositor.
CompositionTechnique * createTechnique()
Create a new technique, and return a pointer to it.
const String & getTextureInstanceName(const String &name, size_t mrtIndex)
Get the instance name for a global texture.
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
TexturePtr getTextureInstance(const String &name, size_t mrtIndex)
Get the instance of a global texture.
void compile()
Check supportedness of techniques.
map< String, MultiRenderTarget * >::type GlobalMRTMap
Store a list of MRTs we've created.
void freeGlobalTextures()
Destroy global rendertextures.
CompositionTechnique * getSupportedTechnique(size_t idx)
Get a supported technique.
void removeTechnique(size_t idx)
Remove a technique.
CompositionTechnique * getSupportedTechnique(const String &schemeName=StringUtil::BLANK)
Get a pointer to a supported technique for a given scheme.
void loadImpl(void)
Internal implementation of the meat of the 'load' action, only called if this resource is not being l...
vector< CompositionTechnique * >::type Techniques
Data types for internal lists.
void createGlobalTextures()
Create global rendertextures.
size_t calculateSize(void) const
Calculate the size of a resource; this will only be called after 'load'.
VectorIterator< Techniques > TechniqueIterator
RenderTarget * getRenderTarget(const String &name)
Get the render target for a given render texture name.
Techniques mTechniques
CompositionTechnique * getTechnique(size_t idx)
Get a technique.
bool mCompilationRequired
Compilation required This is set if the techniques change and the supportedness of techniques has to ...
Interface describing a manual resource loader.
Definition: OgreResource.h:515
A 'canvas' which can receive the results of a rendering operation.
Defines a generic resource handler.
Abstract class representing a loadable resource (e.g.
Definition: OgreResource.h:80
static const String BLANK
Constant blank string, useful for returning by ref where local does not exist.
Definition: OgreString.h:196
Concrete IteratorWrapper for nonconst access to the underlying container.
unsigned long long int ResourceHandle
Definition: OgreResource.h:41
_StringBase String

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.