OGRE: OgreCompositionTechnique.h Source File - OGRE Documentation

# OgreCompositionTechnique.h

Go to the documentation of this file.

    00001 /*
    00002 -----------------------------------------------------------------------------
    00003 This source file is part of OGRE
    00004     (Object-oriented Graphics Rendering Engine)
    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 program is free software; you can redistribute it and/or modify it under
    00011 the terms of the GNU Lesser General Public License as published by the Free Software
    00012 Foundation; either version 2 of the License, or (at your option) any later
    00013 version.
    00014
    00015 This program is distributed in the hope that it will be useful, but WITHOUT
    00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    00018
    00019 You should have received a copy of the GNU Lesser General Public License along with
    00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
    00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
    00022 http://www.gnu.org/copyleft/lesser.txt.
    00023
    00024 You may alternatively use this source under the terms of a specific version of
    00025 the OGRE Unrestricted License provided you have obtained such a license from
    00026 Torus Knot Software Ltd.
    00027 -----------------------------------------------------------------------------
    00028 */
    00029 #ifndef __CompositionTechnique_H__
    00030 #define __CompositionTechnique_H__
    00031
    00032 #include "OgrePrerequisites.h"
    00033 #include "OgrePixelFormat.h"
    00034 #include "OgreIteratorWrappers.h"
    00035
    00036 namespace Ogre {
    00039     class _OgreExport CompositionTechnique : public CompositorInstAlloc
    00040     {
    00041     public:
    00042         CompositionTechnique(Compositor *parent);
    00043         virtual ~CompositionTechnique();
    00044
    00046         class TextureDefinition : public CompositorInstAlloc
    00047         {
    00048         public:
    00049             String name;
    00050             size_t width;       // 0 means adapt to target width
    00051             size_t height;      // 0 means adapt to target height
    00052             float widthFactor;  // multiple of target width to use (if width = 0)
    00053             float heightFactor; // multiple of target height to use (if height = 0)
    00054             PixelFormatList formatList; // more than one means MRT
    00055
    00056             TextureDefinition() :width(0), height(0), widthFactor(1.0f), heightFactor(1.0f) {}
    00057         };
    00059         typedef std::vector<CompositionTargetPass *> TargetPasses;
    00060         typedef VectorIterator<TargetPasses> TargetPassIterator;
    00061         typedef std::vector<TextureDefinition*> TextureDefinitions;
    00062         typedef VectorIterator<TextureDefinitions> TextureDefinitionIterator;
    00063
    00067         TextureDefinition *createTextureDefinition(const String &name);
    00068
    00071         void removeTextureDefinition(size_t idx);
    00072
    00075         TextureDefinition *getTextureDefinition(size_t idx);
    00076
    00079         size_t getNumTextureDefinitions();
    00080
    00083         void removeAllTextureDefinitions();
    00084
    00086         TextureDefinitionIterator getTextureDefinitionIterator(void);
    00087
    00090         CompositionTargetPass *createTargetPass();
    00091
    00094         void removeTargetPass(size_t idx);
    00095
    00098         CompositionTargetPass *getTargetPass(size_t idx);
    00099
    00102         size_t getNumTargetPasses();
    00103
    00106         void removeAllTargetPasses();
    00107
    00109         TargetPassIterator getTargetPassIterator(void);
    00110
    00113         CompositionTargetPass *getOutputTargetPass();
    00114
    00118         virtual bool isSupported(bool allowTextureDegradation);
    00119
    00122         virtual CompositorInstance *createInstance(CompositorChain *chain);
    00123
    00126         virtual void destroyInstance(CompositorInstance *instance);
    00127
    00129         Compositor *getParent();
    00130     private:
    00132         Compositor *mParent;
    00134         TextureDefinitions mTextureDefinitions;
    00135
    00137         TargetPasses mTargetPasses;
    00139         CompositionTargetPass *mOutputTarget;
    00140
    00142         typedef std::vector<CompositorInstance *> Instances;
    00143         Instances mInstances;
    00144     };
    00145
    00146 }
    00147
    00148 #endif

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:32:17 2009