OGRE  1.9.0
OgreCompositor.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2014 Torus Knot Software Ltd
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25THE SOFTWARE.
26-----------------------------------------------------------------------------
27*/
28#ifndef __Compositor_H__
29#define __Compositor_H__
30
31#include "OgrePrerequisites.h"
33#include "OgreResource.h"
34#include "OgreTexture.h"
35#include "OgreHeaderPrefix.h"
36
37namespace 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
76
80
83
91
99
107
115 CompositionTechnique *getSupportedTechnique(const String& schemeName = StringUtil::BLANK);
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
Base composition technique, can be subclassed in plugins.
Class representing a Compositor object.
Techniques mSupportedTechniques
GlobalMRTMap mGlobalMRTs
vector< CompositionTechnique * >::type Techniques
Data types for internal lists.
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 * getSupportedTechnique(size_t idx)
Get a supported technique.
void unloadImpl(void)
Internal implementation of the 'unload' action; called regardless of whether this resource is being l...
const String & getTextureInstanceName(const String &name, size_t mrtIndex)
Get the instance name for a global texture.
TexturePtr getTextureInstance(const String &name, size_t mrtIndex)
Get the instance of a global texture.
CompositionTechnique * getTechnique(size_t idx)
Get a technique.
void compile()
Check supportedness of techniques.
map< String, MultiRenderTarget * >::type GlobalMRTMap
Store a list of MRTs we've created.
void freeGlobalTextures()
Destroy global rendertextures.
void removeTechnique(size_t idx)
Remove a technique.
RenderTarget * getRenderTarget(const String &name)
Get the render target for a given render texture name.
void loadImpl(void)
Internal implementation of the meat of the 'load' action, only called if this resource is not being l...
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
Techniques mTechniques
CompositionTechnique * getSupportedTechnique(const String &schemeName=StringUtil::BLANK)
Get a pointer to a supported technique for a given scheme.
bool mCompilationRequired
Compilation required This is set if the techniques change and the supportedness of techniques has to ...
CompositionTechnique * createTechnique()
Create a new technique, and return a pointer to it.
Interface describing a manual resource loader.
A 'canvas' which can receive the results of a rendering operation.
Defines a generic resource handler.
Abstract class representing a loadable resource (e.g.
Concrete IteratorWrapper for nonconst access to the underlying container.
unsigned long long int ResourceHandle
_StringBase String
std::map< K, V, P, A > type
std::vector< T, A > type