1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreMaterialSerializer.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
9 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> |
---|
10 | <h1>OgreMaterialSerializer.h</h1><a href="OgreMaterialSerializer_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
14 | 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> |
---|
15 | 00006 <span class="comment"></span> |
---|
16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
18 | 00009 <span class="comment"></span> |
---|
19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
20 | 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> |
---|
21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
22 | 00013 <span class="comment">version.</span> |
---|
23 | 00014 <span class="comment"></span> |
---|
24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> |
---|
27 | 00018 <span class="comment"></span> |
---|
28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> |
---|
29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
33 | 00024 <span class="comment">*/</span> |
---|
34 | 00025 <span class="preprocessor">#ifndef __MaterialSerializer_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __MaterialSerializer_H__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgreMaterial_8h.html">OgreMaterial.h</a>"</span> |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreBlendMode_8h.html">OgreBlendMode.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreTextureUnitState_8h.html">OgreTextureUnitState.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreGpuProgram_8h.html">OgreGpuProgram.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreStringVector_8h.html">OgreStringVector.h</a>"</span> |
---|
43 | 00034 |
---|
44 | 00035 <span class="keyword">namespace </span>Ogre { |
---|
45 | 00036 |
---|
46 | <a name="l00038"></a><a class="code" href="namespaceOgre.html#a665">00038</a> <span class="keyword">enum</span> MaterialScriptSection |
---|
47 | 00039 { |
---|
48 | 00040 MSS_NONE, |
---|
49 | 00041 MSS_MATERIAL, |
---|
50 | 00042 MSS_TECHNIQUE, |
---|
51 | 00043 MSS_PASS, |
---|
52 | 00044 MSS_TEXTUREUNIT, |
---|
53 | 00045 MSS_PROGRAM_REF, |
---|
54 | 00046 MSS_PROGRAM, |
---|
55 | 00047 MSS_DEFAULT_PARAMETERS, |
---|
56 | 00048 MSS_TEXTURESOURCE |
---|
57 | 00049 }; |
---|
58 | <a name="l00051"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html">00051</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html">MaterialScriptProgramDefinition</a> |
---|
59 | 00052 { |
---|
60 | <a name="l00053"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono0">00053</a> <a class="code" href="namespaceOgre.html#a471">String</a> name; |
---|
61 | <a name="l00054"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono1">00054</a> <a class="code" href="namespaceOgre.html#a658">GpuProgramType</a> progType; |
---|
62 | <a name="l00055"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono2">00055</a> <a class="code" href="namespaceOgre.html#a471">String</a> language; |
---|
63 | <a name="l00056"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono3">00056</a> <a class="code" href="namespaceOgre.html#a471">String</a> source; |
---|
64 | <a name="l00057"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono4">00057</a> <a class="code" href="namespaceOgre.html#a471">String</a> syntax; |
---|
65 | <a name="l00058"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono5">00058</a> <span class="keywordtype">bool</span> supportsSkeletalAnimation; |
---|
66 | <a name="l00059"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono6">00059</a> <span class="keywordtype">bool</span> supportsMorphAnimation; |
---|
67 | <a name="l00060"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono7">00060</a> <a class="code" href="namespaceOgre.html#a467">ushort</a> supportsPoseAnimation; <span class="comment">// number of simultaneous poses supported</span> |
---|
68 | <a name="l00061"></a><a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html#Ogre_1_1MaterialScriptProgramDefinitiono8">00061</a> std::map<String, String> customParameters; |
---|
69 | 00062 }; |
---|
70 | <a name="l00064"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html">00064</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1MaterialScriptContext.html">MaterialScriptContext</a> |
---|
71 | 00065 { |
---|
72 | <a name="l00066"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto0">00066</a> MaterialScriptSection section; |
---|
73 | <a name="l00067"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto1">00067</a> <a class="code" href="namespaceOgre.html#a471">String</a> groupName; |
---|
74 | <a name="l00068"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto2">00068</a> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a> material; |
---|
75 | <a name="l00069"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto3">00069</a> <a class="code" href="classOgre_1_1Technique.html">Technique</a>* technique; |
---|
76 | <a name="l00070"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto4">00070</a> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pass; |
---|
77 | <a name="l00071"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto5">00071</a> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a>* textureUnit; |
---|
78 | <a name="l00072"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto6">00072</a> <a class="code" href="classOgre_1_1GpuProgramPtr.html">GpuProgramPtr</a> program; <span class="comment">// used when referencing a program, not when defining it</span> |
---|
79 | <a name="l00073"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto7">00073</a> <span class="keywordtype">bool</span> isProgramShadowCaster; <span class="comment">// when referencing, are we in context of shadow caster</span> |
---|
80 | <a name="l00074"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto8">00074</a> <span class="keywordtype">bool</span> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto8">isVertexProgramShadowReceiver</a>; <span class="comment">// when referencing, are we in context of shadow caster</span> |
---|
81 | <a name="l00075"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto9">00075</a> <span class="keywordtype">bool</span> <a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto9">isFragmentProgramShadowReceiver</a>; <span class="comment">// when referencing, are we in context of shadow caster</span> |
---|
82 | <a name="l00076"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto10">00076</a> <a class="code" href="classOgre_1_1SharedPtr.html">GpuProgramParametersSharedPtr</a> programParams; |
---|
83 | <a name="l00077"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto11">00077</a> <a class="code" href="namespaceOgre.html#a467">ushort</a> numAnimationParametrics; |
---|
84 | <a name="l00078"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto12">00078</a> <a class="code" href="structOgre_1_1MaterialScriptProgramDefinition.html">MaterialScriptProgramDefinition</a>* programDef; <span class="comment">// this is used while defining a program</span> |
---|
85 | 00079 |
---|
86 | <a name="l00080"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto13">00080</a> <span class="keywordtype">int</span> techLev, <span class="comment">//Keep track of what tech, pass, and state level we are in</span> |
---|
87 | 00081 passLev, |
---|
88 | 00082 stateLev; |
---|
89 | <a name="l00083"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto16">00083</a> <a class="code" href="namespaceOgre.html#a580">StringVector</a> defaultParamLines; |
---|
90 | 00084 |
---|
91 | 00085 <span class="comment">// Error reporting state</span> |
---|
92 | <a name="l00086"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto17">00086</a> size_t lineNo; |
---|
93 | <a name="l00087"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto18">00087</a> <a class="code" href="namespaceOgre.html#a471">String</a> filename; |
---|
94 | <a name="l00088"></a><a class="code" href="structOgre_1_1MaterialScriptContext.html#Ogre_1_1MaterialScriptContexto19">00088</a> <a class="code" href="namespaceOgre.html#a77">AliasTextureNamePairList</a> textureAliases; |
---|
95 | 00089 }; |
---|
96 | <a name="l00091"></a><a class="code" href="namespaceOgre.html#a342">00091</a> <span class="keyword">typedef</span> bool (*<a class="code" href="namespaceOgre.html#a342">ATTRIBUTE_PARSER</a>)(<a class="code" href="namespaceOgre.html#a471">String</a>& params, <a class="code" href="structOgre_1_1MaterialScriptContext.html">MaterialScriptContext</a>& context); |
---|
97 | 00092 |
---|
98 | <a name="l00094"></a><a class="code" href="classOgre_1_1MaterialSerializer.html">00094</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> MaterialSerializer |
---|
99 | 00095 { |
---|
100 | 00096 <span class="keyword">protected</span>: |
---|
101 | <a name="l00098"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">00098</a> <span class="keyword">typedef</span> std::map<String, ATTRIBUTE_PARSER> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a>; |
---|
102 | 00099 |
---|
103 | <a name="l00100"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp0">00100</a> <a class="code" href="structOgre_1_1MaterialScriptContext.html">MaterialScriptContext</a> mScriptContext; |
---|
104 | 00101 |
---|
105 | 00105 <span class="keywordtype">bool</span> parseScriptLine(<a class="code" href="namespaceOgre.html#a471">String</a>& line); |
---|
106 | 00107 <span class="keywordtype">bool</span> invokeParser(<a class="code" href="namespaceOgre.html#a471">String</a>& line, <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a>& parsers); |
---|
107 | 00111 <span class="keywordtype">void</span> finishProgramDefinition(<span class="keywordtype">void</span>); |
---|
108 | <a name="l00113"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp1">00113</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mRootAttribParsers; |
---|
109 | <a name="l00115"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp2">00115</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mMaterialAttribParsers; |
---|
110 | <a name="l00117"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp3">00117</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mTechniqueAttribParsers; |
---|
111 | <a name="l00119"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp4">00119</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mPassAttribParsers; |
---|
112 | <a name="l00121"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp5">00121</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mTextureUnitAttribParsers; |
---|
113 | <a name="l00123"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp6">00123</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mProgramRefAttribParsers; |
---|
114 | <a name="l00125"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp7">00125</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mProgramAttribParsers; |
---|
115 | <a name="l00127"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerp8">00127</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx0">AttribParserList</a> mProgramDefaultParamAttribParsers; |
---|
116 | 00128 |
---|
117 | 00129 <span class="keywordtype">void</span> writeMaterial(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& pMat); |
---|
118 | 00130 <span class="keywordtype">void</span> writeTechnique(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Technique.html">Technique</a>* pTech); |
---|
119 | 00131 <span class="keywordtype">void</span> writePass(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
120 | 00132 <span class="keywordtype">void</span> writeVertexProgramRef(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
121 | 00133 <span class="keywordtype">void</span> writeShadowCasterVertexProgramRef(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
122 | 00134 <span class="keywordtype">void</span> writeShadowReceiverVertexProgramRef(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
123 | 00135 <span class="keywordtype">void</span> writeShadowReceiverFragmentProgramRef(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
124 | 00136 <span class="keywordtype">void</span> writeFragmentProgramRef(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pPass); |
---|
125 | 00137 <span class="keywordtype">void</span> writeGpuProgramRef(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& attrib, <span class="keyword">const</span> <a class="code" href="classOgre_1_1GpuProgramPtr.html">GpuProgramPtr</a>& program, <span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">GpuProgramParametersSharedPtr</a>& params); |
---|
126 | 00138 <span class="keywordtype">void</span> writeGpuPrograms(<span class="keywordtype">void</span>); |
---|
127 | 00139 <span class="keywordtype">void</span> writeGPUProgramParameters(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">GpuProgramParametersSharedPtr</a>& params, <a class="code" href="classOgre_1_1GpuProgramParameters.html">GpuProgramParameters</a>* defaultParams, |
---|
128 | 00140 <span class="keyword">const</span> <span class="keywordtype">int</span> level = 4, <span class="keyword">const</span> <span class="keywordtype">bool</span> useMainBuffer = <span class="keyword">true</span>); |
---|
129 | 00141 <span class="keywordtype">void</span> writeTextureUnit(<span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
130 | 00142 |
---|
131 | 00143 <span class="keywordtype">void</span> writeSceneBlendFactor(<span class="keyword">const</span> SceneBlendFactor sbf_src, <span class="keyword">const</span> SceneBlendFactor sbf_dest); |
---|
132 | 00144 <span class="keywordtype">void</span> writeSceneBlendFactor(<span class="keyword">const</span> SceneBlendFactor sbf); |
---|
133 | 00145 <span class="keywordtype">void</span> writeCompareFunction(<span class="keyword">const</span> CompareFunction cf); |
---|
134 | 00146 <span class="keywordtype">void</span> writeColourValue(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a> &colour, <span class="keywordtype">bool</span> writeAlpha = <span class="keyword">false</span>); |
---|
135 | 00147 <span class="keywordtype">void</span> writeLayerBlendOperationEx(<span class="keyword">const</span> LayerBlendOperationEx op); |
---|
136 | 00148 <span class="keywordtype">void</span> writeLayerBlendSource(<span class="keyword">const</span> LayerBlendSource lbs); |
---|
137 | 00149 |
---|
138 | <a name="l00150"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx1">00150</a> <span class="keyword">typedef</span> std::multimap<TextureUnitState::TextureEffectType, TextureUnitState::TextureEffect> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerx1">EffectMap</a>; |
---|
139 | 00151 |
---|
140 | 00152 <span class="keywordtype">void</span> writeRotationEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
141 | 00153 <span class="keywordtype">void</span> writeTransformEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
142 | 00154 <span class="keywordtype">void</span> writeScrollEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
143 | 00155 <span class="keywordtype">void</span> writeEnvironmentMapEffect(<span class="keyword">const</span> <a class="code" href="structOgre_1_1TextureUnitState_1_1TextureEffect.html">TextureUnitState::TextureEffect</a>& effect, <span class="keyword">const</span> <a class="code" href="classOgre_1_1TextureUnitState.html">TextureUnitState</a> *pTex); |
---|
144 | 00156 |
---|
145 | 00157 <a class="code" href="namespaceOgre.html#a471">String</a> convertFiltering(FilterOptions fo); |
---|
146 | 00158 <span class="keyword">public</span>: |
---|
147 | 00160 MaterialSerializer(); |
---|
148 | <a name="l00162"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializera1">00162</a> <span class="keyword">virtual</span> ~MaterialSerializer() {}; |
---|
149 | 00163 |
---|
150 | 00170 <span class="keywordtype">void</span> queueForExport(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& pMat, <span class="keywordtype">bool</span> clearQueued = <span class="keyword">false</span>, |
---|
151 | 00171 <span class="keywordtype">bool</span> exportDefaults = <span class="keyword">false</span>); |
---|
152 | 00181 <span class="keywordtype">void</span> exportQueued(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& filename, <span class="keyword">const</span> <span class="keywordtype">bool</span> includeProgDef = <span class="keyword">false</span>, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& programFilename = <span class="stringliteral">""</span>); |
---|
153 | 00191 <span class="keywordtype">void</span> exportMaterial(<span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& pMat, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& filename, <span class="keywordtype">bool</span> exportDefaults = <span class="keyword">false</span>, |
---|
154 | 00192 <span class="keyword">const</span> <span class="keywordtype">bool</span> includeProgDef = <span class="keyword">false</span>, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& programFilename = <span class="stringliteral">""</span>); |
---|
155 | 00194 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a> &getQueuedAsString() <span class="keyword">const</span>; |
---|
156 | 00196 <span class="keywordtype">void</span> clearQueue(); |
---|
157 | 00197 |
---|
158 | 00200 <span class="keywordtype">void</span> parseScript(<a class="code" href="classOgre_1_1SharedPtr.html">DataStreamPtr</a>& stream, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& groupName); |
---|
159 | 00201 |
---|
160 | 00202 |
---|
161 | 00203 |
---|
162 | 00204 <span class="keyword">private</span>: |
---|
163 | <a name="l00205"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerr0">00205</a> <a class="code" href="namespaceOgre.html#a471">String</a> mBuffer; |
---|
164 | <a name="l00206"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerr1">00206</a> <a class="code" href="namespaceOgre.html#a471">String</a> mGpuProgramBuffer; |
---|
165 | <a name="l00207"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializery0">00207</a> <span class="keyword">typedef</span> std::set<String> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializery0">GpuProgramDefinitionContainer</a>; |
---|
166 | <a name="l00208"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializery1">00208</a> <span class="keyword">typedef</span> GpuProgramDefinitionContainer::iterator <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializery1">GpuProgramDefIterator</a>; |
---|
167 | <a name="l00209"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerr2">00209</a> <a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializery0">GpuProgramDefinitionContainer</a> mGpuProgramDefinitionContainer; |
---|
168 | <a name="l00210"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerr3">00210</a> <span class="keywordtype">bool</span> mDefaults; |
---|
169 | 00211 |
---|
170 | <a name="l00212"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd0">00212</a> <span class="keywordtype">void</span> beginSection(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level, <span class="keyword">const</span> <span class="keywordtype">bool</span> useMainBuffer = <span class="keyword">true</span>) |
---|
171 | 00213 { |
---|
172 | 00214 <a class="code" href="namespaceOgre.html#a471">String</a>& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer); |
---|
173 | 00215 buffer += <span class="stringliteral">"\n"</span>; |
---|
174 | 00216 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
175 | 00217 { |
---|
176 | 00218 buffer += <span class="stringliteral">"\t"</span>; |
---|
177 | 00219 } |
---|
178 | 00220 buffer += <span class="stringliteral">"{"</span>; |
---|
179 | 00221 } |
---|
180 | <a name="l00222"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd1">00222</a> <span class="keywordtype">void</span> endSection(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level, <span class="keyword">const</span> <span class="keywordtype">bool</span> useMainBuffer = <span class="keyword">true</span>) |
---|
181 | 00223 { |
---|
182 | 00224 <a class="code" href="namespaceOgre.html#a471">String</a>& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer); |
---|
183 | 00225 buffer += <span class="stringliteral">"\n"</span>; |
---|
184 | 00226 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
185 | 00227 { |
---|
186 | 00228 buffer += <span class="stringliteral">"\t"</span>; |
---|
187 | 00229 } |
---|
188 | 00230 buffer += <span class="stringliteral">"}"</span>; |
---|
189 | 00231 } |
---|
190 | 00232 |
---|
191 | <a name="l00233"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd2">00233</a> <span class="keywordtype">void</span> writeAttribute(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& att, <span class="keyword">const</span> <span class="keywordtype">bool</span> useMainBuffer = <span class="keyword">true</span>) |
---|
192 | 00234 { |
---|
193 | 00235 <a class="code" href="namespaceOgre.html#a471">String</a>& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer); |
---|
194 | 00236 buffer += <span class="stringliteral">"\n"</span>; |
---|
195 | 00237 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
196 | 00238 { |
---|
197 | 00239 buffer += <span class="stringliteral">"\t"</span>; |
---|
198 | 00240 } |
---|
199 | 00241 buffer += att; |
---|
200 | 00242 } |
---|
201 | 00243 |
---|
202 | <a name="l00244"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd3">00244</a> <span class="keywordtype">void</span> writeValue(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& val, <span class="keyword">const</span> <span class="keywordtype">bool</span> useMainBuffer = <span class="keyword">true</span>) |
---|
203 | 00245 { |
---|
204 | 00246 <a class="code" href="namespaceOgre.html#a471">String</a>& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer); |
---|
205 | 00247 buffer += (<span class="stringliteral">" "</span> + val); |
---|
206 | 00248 } |
---|
207 | 00249 |
---|
208 | <a name="l00250"></a><a class="code" href="classOgre_1_1MaterialSerializer.html#Ogre_1_1MaterialSerializerd4">00250</a> <span class="keywordtype">void</span> writeComment(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> level, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& comment, <span class="keyword">const</span> <span class="keywordtype">bool</span> useMainBuffer = <span class="keyword">true</span>) |
---|
209 | 00251 { |
---|
210 | 00252 <a class="code" href="namespaceOgre.html#a471">String</a>& buffer = (useMainBuffer ? mBuffer : mGpuProgramBuffer); |
---|
211 | 00253 buffer += <span class="stringliteral">"\n"</span>; |
---|
212 | 00254 <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> i = 0; i < level; ++i) |
---|
213 | 00255 { |
---|
214 | 00256 buffer += <span class="stringliteral">"\t"</span>; |
---|
215 | 00257 } |
---|
216 | 00258 buffer += <span class="stringliteral">"// "</span> + comment; |
---|
217 | 00259 } |
---|
218 | 00260 |
---|
219 | 00261 }; |
---|
220 | 00262 } |
---|
221 | 00263 <span class="preprocessor">#endif</span> |
---|
222 | </pre></div><hr> |
---|
223 | <p> |
---|
224 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
225 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
226 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
227 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
228 | <Work rdf:about=""> |
---|
229 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
230 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
231 | </Work> |
---|
232 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
233 | |
---|
234 | Last modified Sun Mar 12 14:37:43 2006 |
---|
235 | </p> |
---|
236 | </body> |
---|
237 | </html> |
---|