1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreMaterial.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>OgreMaterial.h</h1><a href="OgreMaterial_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 _Material_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define _Material_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 |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreResource_8h.html">OgreResource.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreIteratorWrappers_8h.html">OgreIteratorWrappers.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreCommon_8h.html">OgreCommon.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreColourValue_8h.html">OgreColourValue.h</a>"</span> |
---|
43 | 00034 <span class="preprocessor">#include "<a class="code" href="OgreBlendMode_8h.html">OgreBlendMode.h</a>"</span> |
---|
44 | 00035 |
---|
45 | 00036 |
---|
46 | 00037 <span class="keyword">namespace </span>Ogre { |
---|
47 | 00038 |
---|
48 | 00039 <span class="comment">// Forward declaration</span> |
---|
49 | 00040 <span class="keyword">class </span>MaterialPtr; |
---|
50 | 00041 |
---|
51 | <a name="l00079"></a><a class="code" href="classOgre_1_1Material.html">00079</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> Material : <span class="keyword">public</span> <a class="code" href="classOgre_1_1Resource.html">Resource</a> |
---|
52 | 00080 { |
---|
53 | <a name="l00081"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialn0">00081</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOgre_1_1SceneManager.html">SceneManager</a>; |
---|
54 | <a name="l00082"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialn1">00082</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOgre_1_1MaterialManager.html">MaterialManager</a>; |
---|
55 | 00083 |
---|
56 | 00084 <span class="keyword">public</span>: |
---|
57 | <a name="l00086"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialw0">00086</a> <span class="keyword">typedef</span> std::vector<Real> <a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialw0">LodDistanceList</a>; |
---|
58 | <a name="l00087"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialw1">00087</a> <span class="keyword">typedef</span> <a class="code" href="classOgre_1_1ConstVectorIterator.html">ConstVectorIterator<LodDistanceList></a> <a class="code" href="classOgre_1_1ConstVectorIterator.html">LodDistanceIterator</a>; |
---|
59 | 00088 <span class="keyword">protected</span>: |
---|
60 | 00089 |
---|
61 | 00090 |
---|
62 | 00093 <span class="keywordtype">void</span> applyDefaults(<span class="keywordtype">void</span>); |
---|
63 | 00094 |
---|
64 | <a name="l00095"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialx0">00095</a> <span class="keyword">typedef</span> std::vector<Technique*> Techniques; |
---|
65 | <a name="l00097"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp0">00097</a> Techniques mTechniques; |
---|
66 | <a name="l00099"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp1">00099</a> Techniques mSupportedTechniques; |
---|
67 | <a name="l00100"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialx1">00100</a> <span class="keyword">typedef</span> std::map<unsigned short, Technique*> <a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialx1">LodTechniques</a>; |
---|
68 | <a name="l00101"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialx2">00101</a> <span class="keyword">typedef</span> std::map<unsigned short, LodTechniques*> <a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialx2">BestTechniquesBySchemeList</a>; |
---|
69 | <a name="l00106"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp2">00106</a> <a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialx2">BestTechniquesBySchemeList</a> mBestTechniquesBySchemeList; |
---|
70 | 00107 |
---|
71 | <a name="l00108"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp3">00108</a> <a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialw0">LodDistanceList</a> mLodDistances; |
---|
72 | <a name="l00109"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp4">00109</a> <span class="keywordtype">bool</span> mReceiveShadows; |
---|
73 | <a name="l00110"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp5">00110</a> <span class="keywordtype">bool</span> mTransparencyCastsShadows; |
---|
74 | <a name="l00112"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialp6">00112</a> <span class="keywordtype">bool</span> mCompilationRequired; |
---|
75 | 00113 |
---|
76 | 00115 <span class="keywordtype">void</span> insertSupportedTechnique(<a class="code" href="classOgre_1_1Technique.html">Technique</a>* t); |
---|
77 | 00116 |
---|
78 | 00119 <span class="keywordtype">void</span> clearBestTechniqueList(<span class="keywordtype">void</span>); |
---|
79 | 00120 |
---|
80 | 00123 <span class="keywordtype">void</span> loadImpl(<span class="keywordtype">void</span>); |
---|
81 | 00124 |
---|
82 | 00129 <span class="keywordtype">void</span> unloadImpl(<span class="keywordtype">void</span>); |
---|
83 | <a name="l00131"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialb5">00131</a> size_t calculateSize(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 0; } <span class="comment">// TODO </span> |
---|
84 | 00132 <span class="keyword">public</span>: |
---|
85 | 00133 |
---|
86 | 00136 Material(<a class="code" href="classOgre_1_1ResourceManager.html">ResourceManager</a>* creator, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& name, <a class="code" href="namespaceOgre.html#a529">ResourceHandle</a> handle, |
---|
87 | 00137 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& group, <span class="keywordtype">bool</span> isManual = <span class="keyword">false</span>, <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a>* loader = 0); |
---|
88 | 00138 |
---|
89 | 00139 ~Material(); |
---|
90 | 00142 Material& operator=( <span class="keyword">const</span> Material& rhs ); |
---|
91 | 00143 |
---|
92 | 00147 <span class="keywordtype">bool</span> isTransparent(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
93 | 00148 |
---|
94 | <a name="l00162"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materiala4">00162</a> <span class="keywordtype">void</span> setReceiveShadows(<span class="keywordtype">bool</span> enabled) { mReceiveShadows = enabled; } |
---|
95 | <a name="l00164"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materiala5">00164</a> <span class="keywordtype">bool</span> getReceiveShadows(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mReceiveShadows; } |
---|
96 | 00165 |
---|
97 | <a name="l00174"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materiala6">00174</a> <span class="keywordtype">void</span> setTransparencyCastsShadows(<span class="keywordtype">bool</span> enabled) { mTransparencyCastsShadows = enabled; } |
---|
98 | <a name="l00176"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materiala7">00176</a> <span class="keywordtype">bool</span> getTransparencyCastsShadows(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mTransparencyCastsShadows; } |
---|
99 | 00177 |
---|
100 | 00192 <a class="code" href="classOgre_1_1Technique.html">Technique</a>* createTechnique(<span class="keywordtype">void</span>); |
---|
101 | 00194 <a class="code" href="classOgre_1_1Technique.html">Technique</a>* getTechnique(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
102 | 00198 <a class="code" href="classOgre_1_1Technique.html">Technique</a>* getTechnique(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& name); |
---|
103 | 00200 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getNumTechniques(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
104 | 00202 <span class="keywordtype">void</span> removeTechnique(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
105 | 00204 <span class="keywordtype">void</span> removeAllTechniques(<span class="keywordtype">void</span>); |
---|
106 | <a name="l00205"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialw2">00205</a> <span class="keyword">typedef</span> <a class="code" href="classOgre_1_1VectorIterator.html">VectorIterator<Techniques></a> TechniqueIterator; |
---|
107 | 00207 TechniqueIterator getTechniqueIterator(<span class="keywordtype">void</span>); |
---|
108 | 00214 TechniqueIterator getSupportedTechniqueIterator(<span class="keywordtype">void</span>); |
---|
109 | 00215 |
---|
110 | 00217 <a class="code" href="classOgre_1_1Technique.html">Technique</a>* getSupportedTechnique(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
111 | 00219 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getNumSupportedTechniques(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
112 | 00220 |
---|
113 | 00226 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getNumLodLevels(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> schemeIndex) <span class="keyword">const</span>; |
---|
114 | 00232 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getNumLodLevels(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& schemeName) <span class="keyword">const</span>; |
---|
115 | 00233 |
---|
116 | 00245 <a class="code" href="classOgre_1_1Technique.html">Technique</a>* getBestTechnique(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> lodIndex = 0); |
---|
117 | 00246 |
---|
118 | 00247 |
---|
119 | 00253 <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a> clone(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& newName, <span class="keywordtype">bool</span> changeGroup = <span class="keyword">false</span>, |
---|
120 | 00254 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& newGroup = StringUtil::BLANK) <span class="keyword">const</span>; |
---|
121 | 00255 |
---|
122 | 00260 <span class="keywordtype">void</span> copyDetailsTo(<a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& mat) <span class="keyword">const</span>; |
---|
123 | 00261 |
---|
124 | 00277 <span class="keywordtype">void</span> compile(<span class="keywordtype">bool</span> autoManageTextureUnits = <span class="keyword">true</span>); |
---|
125 | 00278 |
---|
126 | 00279 <span class="comment">// -------------------------------------------------------------------------------</span> |
---|
127 | 00280 <span class="comment">// The following methods are to make migration from previous versions simpler</span> |
---|
128 | 00281 <span class="comment">// and to make code easier to write when dealing with simple materials</span> |
---|
129 | 00282 <span class="comment">// They set the properties which have been moved to Pass for all Techniques and all Passes</span> |
---|
130 | 00283 |
---|
131 | 00293 <span class="keywordtype">void</span> setPointSize(<a class="code" href="namespaceOgre.html#a465">Real</a> ps); |
---|
132 | 00294 |
---|
133 | 00304 <span class="keywordtype">void</span> setAmbient(<a class="code" href="namespaceOgre.html#a465">Real</a> red, <a class="code" href="namespaceOgre.html#a465">Real</a> green, <a class="code" href="namespaceOgre.html#a465">Real</a> blue); |
---|
134 | 00305 |
---|
135 | 00315 <span class="keywordtype">void</span> setAmbient(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a>& ambient); |
---|
136 | 00316 |
---|
137 | 00326 <span class="keywordtype">void</span> setDiffuse(<a class="code" href="namespaceOgre.html#a465">Real</a> red, <a class="code" href="namespaceOgre.html#a465">Real</a> green, <a class="code" href="namespaceOgre.html#a465">Real</a> blue, <a class="code" href="namespaceOgre.html#a465">Real</a> alpha); |
---|
138 | 00327 |
---|
139 | 00337 <span class="keywordtype">void</span> setDiffuse(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a>& diffuse); |
---|
140 | 00338 |
---|
141 | 00348 <span class="keywordtype">void</span> setSpecular(<a class="code" href="namespaceOgre.html#a465">Real</a> red, <a class="code" href="namespaceOgre.html#a465">Real</a> green, <a class="code" href="namespaceOgre.html#a465">Real</a> blue, <a class="code" href="namespaceOgre.html#a465">Real</a> alpha); |
---|
142 | 00349 |
---|
143 | 00359 <span class="keywordtype">void</span> setSpecular(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a>& specular); |
---|
144 | 00360 |
---|
145 | 00370 <span class="keywordtype">void</span> setShininess(<a class="code" href="namespaceOgre.html#a465">Real</a> val); |
---|
146 | 00371 |
---|
147 | 00381 <span class="keywordtype">void</span> setSelfIllumination(<a class="code" href="namespaceOgre.html#a465">Real</a> red, <a class="code" href="namespaceOgre.html#a465">Real</a> green, <a class="code" href="namespaceOgre.html#a465">Real</a> blue); |
---|
148 | 00382 |
---|
149 | 00392 <span class="keywordtype">void</span> setSelfIllumination(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a>& selfIllum); |
---|
150 | 00393 |
---|
151 | 00403 <span class="keywordtype">void</span> setDepthCheckEnabled(<span class="keywordtype">bool</span> enabled); |
---|
152 | 00404 |
---|
153 | 00414 <span class="keywordtype">void</span> setDepthWriteEnabled(<span class="keywordtype">bool</span> enabled); |
---|
154 | 00415 |
---|
155 | 00425 <span class="keywordtype">void</span> setDepthFunction( CompareFunction func ); |
---|
156 | 00426 |
---|
157 | 00436 <span class="keywordtype">void</span> setColourWriteEnabled(<span class="keywordtype">bool</span> enabled); |
---|
158 | 00437 |
---|
159 | 00447 <span class="keywordtype">void</span> setCullingMode( CullingMode mode ); |
---|
160 | 00448 |
---|
161 | 00458 <span class="keywordtype">void</span> setManualCullingMode( ManualCullingMode mode ); |
---|
162 | 00459 |
---|
163 | 00469 <span class="keywordtype">void</span> setLightingEnabled(<span class="keywordtype">bool</span> enabled); |
---|
164 | 00470 |
---|
165 | 00480 <span class="keywordtype">void</span> setShadingMode( ShadeOptions mode ); |
---|
166 | 00481 |
---|
167 | 00491 <span class="keywordtype">void</span> setFog( |
---|
168 | 00492 <span class="keywordtype">bool</span> overrideScene, |
---|
169 | 00493 FogMode mode = FOG_NONE, |
---|
170 | 00494 <span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a>& colour = ColourValue::White, |
---|
171 | 00495 <a class="code" href="namespaceOgre.html#a465">Real</a> expDensity = 0.001, <a class="code" href="namespaceOgre.html#a465">Real</a> linearStart = 0.0, <a class="code" href="namespaceOgre.html#a465">Real</a> linearEnd = 1.0 ); |
---|
172 | 00496 |
---|
173 | 00506 <span class="keywordtype">void</span> setDepthBias(<a class="code" href="namespaceOgre.html#a467">ushort</a> bias); |
---|
174 | 00507 |
---|
175 | 00516 <span class="keywordtype">void</span> setTextureFiltering(TextureFilterOptions filterType); |
---|
176 | 00525 <span class="keywordtype">void</span> setTextureAnisotropy(<span class="keywordtype">int</span> maxAniso); |
---|
177 | 00526 |
---|
178 | 00536 <span class="keywordtype">void</span> setSceneBlending( <span class="keyword">const</span> SceneBlendType sbt ); |
---|
179 | 00537 |
---|
180 | 00547 <span class="keywordtype">void</span> setSceneBlending( <span class="keyword">const</span> SceneBlendFactor sourceFactor, <span class="keyword">const</span> SceneBlendFactor destFactor); |
---|
181 | 00548 |
---|
182 | 00549 |
---|
183 | 00551 <span class="keywordtype">void</span> _notifyNeedsRecompile(<span class="keywordtype">void</span>); |
---|
184 | 00552 |
---|
185 | 00565 <span class="keywordtype">void</span> setLodLevels(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materialw0">LodDistanceList</a>& lodDistances); |
---|
186 | 00573 <a class="code" href="classOgre_1_1ConstVectorIterator.html">LodDistanceIterator</a> getLodDistanceIterator(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
187 | 00574 |
---|
188 | 00576 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getLodIndex(<a class="code" href="namespaceOgre.html#a465">Real</a> d) <span class="keyword">const</span>; |
---|
189 | 00578 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getLodIndexSquaredDepth(<a class="code" href="namespaceOgre.html#a465">Real</a> squaredDepth) <span class="keyword">const</span>; |
---|
190 | 00579 |
---|
191 | <a name="l00582"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materiala53">00582</a> <span class="keywordtype">void</span> touch(<span class="keywordtype">void</span>) |
---|
192 | 00583 { |
---|
193 | 00584 <span class="keywordflow">if</span> (mCompilationRequired) |
---|
194 | 00585 compile(); |
---|
195 | 00586 <span class="comment">// call superclass</span> |
---|
196 | 00587 Resource::touch(); |
---|
197 | 00588 } |
---|
198 | 00589 |
---|
199 | 00601 <span class="keywordtype">bool</span> applyTextureAliases(<span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a77">AliasTextureNamePairList</a>& aliasList, <span class="keyword">const</span> <span class="keywordtype">bool</span> apply = <span class="keyword">true</span>) <span class="keyword">const</span>; |
---|
200 | 00602 |
---|
201 | <a name="l00606"></a><a class="code" href="classOgre_1_1Material.html#Ogre_1_1Materiala55">00606</a> <span class="keywordtype">bool</span> getCompilationRequired()<span class="keyword"> const</span> |
---|
202 | 00607 <span class="keyword"> </span>{ |
---|
203 | 00608 <span class="keywordflow">return</span> mCompilationRequired; |
---|
204 | 00609 } |
---|
205 | 00610 |
---|
206 | 00611 |
---|
207 | 00612 }; |
---|
208 | 00613 |
---|
209 | <a name="l00620"></a><a class="code" href="classOgre_1_1MaterialPtr.html">00620</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> MaterialPtr : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Material> |
---|
210 | 00621 { |
---|
211 | 00622 <span class="keyword">public</span>: |
---|
212 | <a name="l00623"></a><a class="code" href="classOgre_1_1MaterialPtr.html#Ogre_1_1MaterialPtra0">00623</a> MaterialPtr() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Material>() {} |
---|
213 | <a name="l00624"></a><a class="code" href="classOgre_1_1MaterialPtr.html#Ogre_1_1MaterialPtra1">00624</a> <span class="keyword">explicit</span> MaterialPtr(Material* rep) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Material>(rep) {} |
---|
214 | <a name="l00625"></a><a class="code" href="classOgre_1_1MaterialPtr.html#Ogre_1_1MaterialPtra2">00625</a> MaterialPtr(<span class="keyword">const</span> MaterialPtr& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Material>(r) {} |
---|
215 | <a name="l00626"></a><a class="code" href="classOgre_1_1MaterialPtr.html#Ogre_1_1MaterialPtra3">00626</a> MaterialPtr(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Material>() |
---|
216 | 00627 { |
---|
217 | 00628 <span class="comment">// lock & copy other mutex pointer</span> |
---|
218 | 00629 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
219 | 00630 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
220 | 00631 pRep = static_cast<Material*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
221 | 00632 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
222 | 00633 <span class="keywordflow">if</span> (pUseCount) |
---|
223 | 00634 { |
---|
224 | 00635 ++(*pUseCount); |
---|
225 | 00636 } |
---|
226 | 00637 } |
---|
227 | 00638 |
---|
228 | <a name="l00640"></a><a class="code" href="classOgre_1_1MaterialPtr.html#Ogre_1_1MaterialPtra4">00640</a> MaterialPtr& operator=(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) |
---|
229 | 00641 { |
---|
230 | 00642 <span class="keywordflow">if</span> (pRep == static_cast<Material*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
231 | 00643 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
232 | 00644 release(); |
---|
233 | 00645 <span class="comment">// lock & copy other mutex pointer</span> |
---|
234 | 00646 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
235 | 00647 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
236 | 00648 pRep = static_cast<Material*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
237 | 00649 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
238 | 00650 <span class="keywordflow">if</span> (pUseCount) |
---|
239 | 00651 { |
---|
240 | 00652 ++(*pUseCount); |
---|
241 | 00653 } |
---|
242 | 00654 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
243 | 00655 } |
---|
244 | 00656 }; |
---|
245 | 00657 |
---|
246 | 00658 } <span class="comment">//namespace </span> |
---|
247 | 00659 |
---|
248 | 00660 <span class="preprocessor">#endif</span> |
---|
249 | </pre></div><hr> |
---|
250 | <p> |
---|
251 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
252 | <!--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/> |
---|
253 | 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/> |
---|
254 | <!--/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#"> |
---|
255 | <Work rdf:about=""> |
---|
256 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
257 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
258 | </Work> |
---|
259 | <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> --> |
---|
260 | |
---|
261 | Last modified Sun Mar 12 14:37:43 2006 |
---|
262 | </p> |
---|
263 | </body> |
---|
264 | </html> |
---|