OgreShaderMaterialSerializerListener.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef _ShaderMaterialSerializerListener_
#define _ShaderMaterialSerializerListener_
#include "OgreShaderPrerequisites.h"
#include "OgreMaterialSerializer.h"
#include "OgreShaderGenerator.h"
namespace Ogre {
namespace RTShader {
class _OgreRTSSExport SGMaterialSerializerListener : public MaterialSerializer::Listener, public RTShaderSystemAlloc
{
// Interface.
public:
virtual void materialEventRaised(MaterialSerializer* ser,
MaterialSerializer::SerializeEvent event, bool& skip, const Material* mat);
virtual void techniqueEventRaised(MaterialSerializer* ser,
MaterialSerializer::SerializeEvent event, bool& skip, const Technique* tech);
virtual void passEventRaised(MaterialSerializer* ser,
MaterialSerializer::SerializeEvent event, bool& skip, const Pass* tech);
virtual void textureUnitStateEventRaised(MaterialSerializer* ser,
MaterialSerializer::SerializeEvent event, bool& skip, const TextureUnitState* textureUnit);
// Types.
protected:
typedef vector<ShaderGenerator::SGPass*>::type SGPassList;
typedef SGPassList::iterator SGPassListIterator;
typedef SGPassList::const_iterator SGPassListConstIterator;
// Protected methods.
protected:
SGMaterialSerializerListener();
~SGMaterialSerializerListener();
void createSGPassList(Material* mat, SGPassList& passList);
ShaderGenerator::SGPass* getShaderGeneratedPass (const Pass* srcPass);
// Attributes.
protected:
// The current source material that is being written.
Material* mSourceMaterial;
// List of SGPass instances composing this material.
SGPassList mSGPassList;
private:
friend class ShaderGenerator;
};
}
}
#endif
Ogre::MaterialSerializer
Class for serializing Materials to / from a .material script.
Definition: OgreMaterialSerializer.h:106
Ogre::Pass
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:80
Ogre::RTShader::SGMaterialSerializerListener::mSourceMaterial
Material * mSourceMaterial
Definition: OgreShaderMaterialSerializerListener.h:99
Ogre::MaterialSerializer::Listener
Class that allows listening in on the various stages of material serialization process.
Definition: OgreMaterialSerializer.h:122
Ogre::RTShader::ShaderGenerator
Shader generator system main interface.
Definition: OgreShaderGenerator.h:53
OgreShaderPrerequisites.h
Ogre::TextureUnitState
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
Definition: OgreTextureUnitState.h:62
Ogre::RTShader::SGMaterialSerializerListener::SGPassList
vector< ShaderGenerator::SGPass * >::type SGPassList
Definition: OgreShaderMaterialSerializerListener.h:79
Ogre::MaterialSerializer::SerializeEvent
SerializeEvent
Definition: OgreMaterialSerializer.h:111
Ogre::RTShader::ShaderGenerator::SGPass
Shader generator pass wrapper class.
Definition: OgreShaderGenerator.h:509
_OgreRTSSExport
#define _OgreRTSSExport
Definition: OgreShaderPrerequisites.h:108
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::Material
Class encapsulates rendering properties of an object.
Definition: OgreMaterial.h:88
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::Technique
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:53
OgreMaterialSerializer.h
Ogre::RTShader::SGMaterialSerializerListener::SGPassListIterator
SGPassList::iterator SGPassListIterator
Definition: OgreShaderMaterialSerializerListener.h:80
Ogre::RTShader::SGMaterialSerializerListener::mSGPassList
SGPassList mSGPassList
Definition: OgreShaderMaterialSerializerListener.h:101
Ogre::RTShader::SGMaterialSerializerListener::SGPassListConstIterator
SGPassList::const_iterator SGPassListConstIterator
Definition: OgreShaderMaterialSerializerListener.h:81
Ogre::RTShader::SGMaterialSerializerListener
This class responsible for translating core features of the RT Shader System for Ogre material script...
Definition: OgreShaderMaterialSerializerListener.h:47
OgreShaderGenerator.h
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58

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