OgreShaderScriptTranslator.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 _ShaderScriptTranslator_
#define _ShaderScriptTranslator_
#include "OgreShaderPrerequisites.h"
#include "OgreScriptTranslator.h"
#include "OgreScriptCompiler.h"
namespace Ogre {
namespace RTShader {
class _OgreRTSSExport SGScriptTranslator : public ScriptTranslator
{
public:
SGScriptTranslator();
virtual void translate(ScriptCompiler *compiler, const AbstractNodePtr &node);
using ScriptTranslator::getBoolean;
using ScriptTranslator::getString;
using ScriptTranslator::getReal;
using ScriptTranslator::getFloat;
using ScriptTranslator::getInt;
using ScriptTranslator::getUInt;
using ScriptTranslator::getColour;
virtual SubRenderState* getGeneratedSubRenderState(const String& typeName);
protected:
void translatePass(ScriptCompiler *compiler, const AbstractNodePtr &node);
void translateTextureUnit(ScriptCompiler *compiler, const AbstractNodePtr &node);
void addSubRenderState(SubRenderState* newSubRenderState,
const String& dstTechniqueSchemeName, const String& materialName,
const String& groupName, unsigned short passIndex);
protected:
//Render state created as a result of the current node being parsed
RenderState* mGeneratedRenderState;
};
}
}
#endif
Ogre::ScriptTranslator::getString
static bool getString(const AbstractNodePtr &node, String *result)
Converts the node to a string and returns true if successful.
Ogre::RTShader::SubRenderState
This class is the base interface of sub part from a shader based rendering pipeline.
Definition: OgreShaderSubRenderState.h:56
Ogre::ScriptTranslator
This class translates script AST (abstract syntax tree) into Ogre resources.
Definition: OgreScriptTranslator.h:48
OgreScriptCompiler.h
Ogre::ScriptTranslator::getUInt
static bool getUInt(const AbstractNodePtr &node, uint32 *result)
Converts the node to an unsigned integer and returns true if successful.
OgreShaderPrerequisites.h
Ogre::ScriptTranslator::getBoolean
static bool getBoolean(const AbstractNodePtr &node, bool *result)
Converts the node to a boolean and returns true if successful.
Ogre::ScriptTranslator::getReal
static bool getReal(const AbstractNodePtr &node, Real *result)
Converts the node to a Real and returns true if successful.
Ogre::ScriptTranslator::getColour
static bool getColour(AbstractNodeList::const_iterator i, AbstractNodeList::const_iterator end, ColourValue *result, int maxEntries=4)
Converts the range of nodes to a ColourValue and returns true if successful.
Ogre::RTShader::RenderState
This is a container class for sub render state class.
Definition: OgreShaderRenderState.h:49
Ogre::RTShader::SGScriptTranslator
This class responsible for translating core features of the RT Shader System for Ogre material script...
Definition: OgreShaderScriptTranslator.h:47
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
_OgreRTSSExport
#define _OgreRTSSExport
Definition: OgreShaderPrerequisites.h:108
Ogre::ScriptTranslator::getFloat
static bool getFloat(const AbstractNodePtr &node, float *result)
Converts the node to a float and returns true if successful.
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::ScriptTranslator::getInt
static bool getInt(const AbstractNodePtr &node, int *result)
Converts the node to an integer and returns true if successful.
Ogre::SharedPtr
Reference-counted shared pointer, used for objects where implicit destruction is required.
Definition: OgrePrerequisites.h:310
Ogre::RTShader::SGScriptTranslator::mGeneratedRenderState
RenderState * mGeneratedRenderState
Definition: OgreShaderScriptTranslator.h:138
Ogre::ScriptCompiler
This is the main class for the compiler.
Definition: OgreScriptCompiler.h:188
OgreScriptTranslator.h

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