1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreTexture.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>OgreTexture.h</h1><a href="OgreTexture_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 _Texture_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define _Texture_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="OgreHardwareBuffer_8h.html">OgreHardwareBuffer.h</a>"</span> |
---|
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="OgreImage_8h.html">OgreImage.h</a>"</span> |
---|
41 | 00032 |
---|
42 | 00033 <span class="keyword">namespace </span>Ogre { |
---|
43 | 00034 |
---|
44 | <a name="l00037"></a><a class="code" href="namespaceOgre.html#a684">00037</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a684">TextureUsage</a> |
---|
45 | 00038 { |
---|
46 | 00040 <a class="code" href="namespaceOgre.html#a684a582">TU_STATIC</a> = HardwareBuffer::HBU_STATIC, |
---|
47 | 00041 <a class="code" href="namespaceOgre.html#a684a583">TU_DYNAMIC</a> = HardwareBuffer::HBU_DYNAMIC, |
---|
48 | 00042 <a class="code" href="namespaceOgre.html#a684a584">TU_WRITE_ONLY</a> = HardwareBuffer::HBU_WRITE_ONLY, |
---|
49 | 00043 <a class="code" href="namespaceOgre.html#a684a585">TU_STATIC_WRITE_ONLY</a> = HardwareBuffer::HBU_STATIC_WRITE_ONLY, |
---|
50 | 00044 <a class="code" href="namespaceOgre.html#a684a586">TU_DYNAMIC_WRITE_ONLY</a> = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, |
---|
51 | 00045 <a class="code" href="namespaceOgre.html#a684a587">TU_DYNAMIC_WRITE_ONLY_DISCARDABLE</a> = HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, |
---|
52 | 00047 <a class="code" href="namespaceOgre.html#a684a588">TU_AUTOMIPMAP</a> = 0x100, |
---|
53 | 00050 <a class="code" href="namespaceOgre.html#a684a589">TU_RENDERTARGET</a> = 0x200, |
---|
54 | 00052 <a class="code" href="namespaceOgre.html#a684a590">TU_DEFAULT</a> = <a class="code" href="namespaceOgre.html#a684a588">TU_AUTOMIPMAP</a> | <a class="code" href="namespaceOgre.html#a684a585">TU_STATIC_WRITE_ONLY</a> |
---|
55 | 00053 |
---|
56 | 00054 }; |
---|
57 | 00055 |
---|
58 | <a name="l00058"></a><a class="code" href="namespaceOgre.html#a685">00058</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a685">TextureType</a> |
---|
59 | 00059 { |
---|
60 | 00061 <a class="code" href="namespaceOgre.html#a685a591">TEX_TYPE_1D</a> = 1, |
---|
61 | 00063 <a class="code" href="namespaceOgre.html#a685a592">TEX_TYPE_2D</a> = 2, |
---|
62 | 00065 <a class="code" href="namespaceOgre.html#a685a593">TEX_TYPE_3D</a> = 3, |
---|
63 | 00067 <a class="code" href="namespaceOgre.html#a685a594">TEX_TYPE_CUBE_MAP</a> = 4 |
---|
64 | 00068 }; |
---|
65 | 00069 |
---|
66 | <a name="l00072"></a><a class="code" href="namespaceOgre.html#a686">00072</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a686">TextureMipmap</a> |
---|
67 | 00073 { |
---|
68 | 00075 <a class="code" href="namespaceOgre.html#a686a595">MIP_UNLIMITED</a> = 0x7FFFFFFF |
---|
69 | 00076 }; |
---|
70 | 00077 |
---|
71 | 00078 <span class="comment">// Forward declaration</span> |
---|
72 | 00079 <span class="keyword">class </span>TexturePtr; |
---|
73 | 00080 |
---|
74 | <a name="l00090"></a><a class="code" href="classOgre_1_1Texture.html">00090</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> Texture : <span class="keyword">public</span> <a class="code" href="classOgre_1_1Resource.html">Resource</a> |
---|
75 | 00091 { |
---|
76 | 00092 <span class="keyword">public</span>: |
---|
77 | 00093 Texture(<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, |
---|
78 | 00094 <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); |
---|
79 | 00095 |
---|
80 | <a name="l00098"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea1">00098</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setTextureType(TextureType ttype ) { mTextureType = ttype; } |
---|
81 | 00099 |
---|
82 | <a name="l00102"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea2">00102</a> <span class="keyword">virtual</span> <a class="code" href="namespaceOgre.html#a685">TextureType</a> getTextureType(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mTextureType; } |
---|
83 | 00103 |
---|
84 | <a name="l00106"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea3">00106</a> <span class="keyword">virtual</span> size_t getNumMipmaps(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{<span class="keywordflow">return</span> mNumMipmaps;} |
---|
85 | 00107 |
---|
86 | <a name="l00112"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea4">00112</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setNumMipmaps(size_t num) {mNumRequestedMipmaps = mNumMipmaps = num;} |
---|
87 | 00113 |
---|
88 | <a name="l00118"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea5">00118</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getMipmapsHardwareGenerated(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mMipmapsHardwareGenerated; } |
---|
89 | 00119 |
---|
90 | <a name="l00122"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea6">00122</a> <span class="keyword">virtual</span> <span class="keywordtype">float</span> getGamma(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mGamma; } |
---|
91 | 00123 |
---|
92 | <a name="l00128"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea7">00128</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setGamma(<span class="keywordtype">float</span> g) { mGamma = g; } |
---|
93 | 00129 |
---|
94 | <a name="l00132"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea8">00132</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getHeight(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mHeight; } |
---|
95 | 00133 |
---|
96 | <a name="l00136"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea9">00136</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getWidth(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mWidth; } |
---|
97 | 00137 |
---|
98 | <a name="l00140"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea10">00140</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDepth(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mDepth; } |
---|
99 | 00141 |
---|
100 | <a name="l00144"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea11">00144</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getSrcHeight(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSrcHeight; } |
---|
101 | 00145 |
---|
102 | <a name="l00148"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea12">00148</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getSrcWidth(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSrcWidth; } |
---|
103 | 00149 |
---|
104 | <a name="l00152"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea13">00152</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getSrcDepth(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSrcDepth; } |
---|
105 | 00153 |
---|
106 | <a name="l00156"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea14">00156</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setHeight(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> h) { mHeight = mSrcHeight = h; } |
---|
107 | 00157 |
---|
108 | <a name="l00160"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea15">00160</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setWidth(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> w) { mWidth = mSrcWidth = w; } |
---|
109 | 00161 |
---|
110 | <a name="l00165"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea16">00165</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setDepth(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> d) { mDepth = mSrcDepth = d; } |
---|
111 | 00166 |
---|
112 | <a name="l00169"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea17">00169</a> <span class="keyword">virtual</span> <span class="keywordtype">int</span> getUsage()<span class="keyword"> const</span> |
---|
113 | 00170 <span class="keyword"> </span>{ |
---|
114 | 00171 <span class="keywordflow">return</span> mUsage; |
---|
115 | 00172 } |
---|
116 | 00173 |
---|
117 | <a name="l00181"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea18">00181</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setUsage(<span class="keywordtype">int</span> u) { mUsage = u; } |
---|
118 | 00182 |
---|
119 | 00194 <span class="keyword">virtual</span> <span class="keywordtype">void</span> createInternalResources(<span class="keywordtype">void</span>); |
---|
120 | 00195 |
---|
121 | 00198 <span class="keyword">virtual</span> <span class="keywordtype">void</span> freeInternalResources(<span class="keywordtype">void</span>); |
---|
122 | 00199 |
---|
123 | 00202 <span class="keyword">virtual</span> <span class="keywordtype">void</span> copyToTexture( <a class="code" href="classOgre_1_1TexturePtr.html">TexturePtr</a>& target ); |
---|
124 | 00203 |
---|
125 | 00206 <span class="keyword">virtual</span> <span class="keywordtype">void</span> loadImage( <span class="keyword">const</span> <a class="code" href="classOgre_1_1Image.html">Image</a> &img ) = 0; |
---|
126 | 00207 |
---|
127 | 00210 <span class="keyword">virtual</span> <span class="keywordtype">void</span> loadRawData( <a class="code" href="classOgre_1_1SharedPtr.html">DataStreamPtr</a>& stream, |
---|
128 | 00211 <a class="code" href="namespaceOgre.html#a467">ushort</a> uWidth, <a class="code" href="namespaceOgre.html#a467">ushort</a> uHeight, PixelFormat eFormat); |
---|
129 | 00212 |
---|
130 | <a name="l00213"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea24">00213</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> enable32Bit( <span class="keywordtype">bool</span> setting = <span class="keyword">true</span> ) |
---|
131 | 00214 { |
---|
132 | 00215 setting ? mFinalBpp = 32 : mFinalBpp = 16; |
---|
133 | 00216 } |
---|
134 | 00217 |
---|
135 | <a name="l00219"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea25">00219</a> <span class="keyword">virtual</span> <a class="code" href="namespaceOgre.html#a671">PixelFormat</a> getFormat()<span class="keyword"> const</span> |
---|
136 | 00220 <span class="keyword"> </span>{ |
---|
137 | 00221 <span class="keywordflow">return</span> mFormat; |
---|
138 | 00222 } |
---|
139 | 00223 |
---|
140 | 00225 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setFormat(PixelFormat pf); |
---|
141 | 00226 |
---|
142 | <a name="l00228"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturea27">00228</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> hasAlpha(<span class="keywordtype">void</span>)<span class="keyword"> const</span> |
---|
143 | 00229 <span class="keyword"> </span>{ |
---|
144 | 00230 <span class="keywordflow">return</span> mHasAlpha; |
---|
145 | 00231 } |
---|
146 | 00232 |
---|
147 | 00236 <span class="keyword">virtual</span> size_t getNumFaces() <span class="keyword">const</span>; |
---|
148 | 00237 |
---|
149 | 00250 <span class="keyword">virtual</span> <a class="code" href="classOgre_1_1HardwarePixelBufferSharedPtr.html">HardwarePixelBufferSharedPtr</a> getBuffer(size_t face=0, size_t mipmap=0) = 0; |
---|
150 | 00251 |
---|
151 | 00252 <span class="keyword">protected</span>: |
---|
152 | <a name="l00253"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep0">00253</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mHeight; |
---|
153 | <a name="l00254"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep1">00254</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mWidth; |
---|
154 | <a name="l00255"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep2">00255</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mDepth; |
---|
155 | 00256 |
---|
156 | <a name="l00257"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep3">00257</a> size_t mNumRequestedMipmaps; |
---|
157 | <a name="l00258"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep4">00258</a> size_t mNumMipmaps; |
---|
158 | <a name="l00259"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep5">00259</a> <span class="keywordtype">bool</span> mMipmapsHardwareGenerated; |
---|
159 | <a name="l00260"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep6">00260</a> <span class="keywordtype">float</span> mGamma; |
---|
160 | 00261 |
---|
161 | <a name="l00262"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep7">00262</a> <a class="code" href="namespaceOgre.html#a685">TextureType</a> mTextureType; |
---|
162 | <a name="l00263"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep8">00263</a> <a class="code" href="namespaceOgre.html#a671">PixelFormat</a> mFormat; |
---|
163 | <a name="l00264"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep9">00264</a> <span class="keywordtype">int</span> mUsage; <span class="comment">// Bit field, so this can't be TextureUsage</span> |
---|
164 | 00265 |
---|
165 | <a name="l00266"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep10">00266</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> mSrcBpp; |
---|
166 | <a name="l00267"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep11">00267</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> mSrcWidth, mSrcHeight, mSrcDepth; |
---|
167 | <a name="l00268"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep14">00268</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> mFinalBpp; |
---|
168 | <a name="l00269"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep15">00269</a> <span class="keywordtype">bool</span> mHasAlpha; |
---|
169 | 00270 |
---|
170 | <a name="l00271"></a><a class="code" href="classOgre_1_1Texture.html#Ogre_1_1Texturep16">00271</a> <span class="keywordtype">bool</span> mInternalResourcesCreated; |
---|
171 | 00272 |
---|
172 | 00274 size_t calculateSize(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
173 | 00275 |
---|
174 | 00284 <span class="keyword">virtual</span> <span class="keywordtype">void</span> _loadImages( <span class="keyword">const</span> std::vector<const Image*>& images ); |
---|
175 | 00285 |
---|
176 | 00286 |
---|
177 | 00289 <span class="keyword">virtual</span> <span class="keywordtype">void</span> createInternalResourcesImpl(<span class="keywordtype">void</span>) = 0; |
---|
178 | 00290 |
---|
179 | 00293 <span class="keyword">virtual</span> <span class="keywordtype">void</span> freeInternalResourcesImpl(<span class="keywordtype">void</span>) = 0; |
---|
180 | 00294 |
---|
181 | 00296 <span class="keywordtype">void</span> unloadImpl(<span class="keywordtype">void</span>); |
---|
182 | 00297 |
---|
183 | 00298 }; |
---|
184 | 00299 |
---|
185 | <a name="l00306"></a><a class="code" href="classOgre_1_1TexturePtr.html">00306</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> TexturePtr : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Texture> |
---|
186 | 00307 { |
---|
187 | 00308 <span class="keyword">public</span>: |
---|
188 | <a name="l00309"></a><a class="code" href="classOgre_1_1TexturePtr.html#Ogre_1_1TexturePtra0">00309</a> TexturePtr() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Texture>() {} |
---|
189 | <a name="l00310"></a><a class="code" href="classOgre_1_1TexturePtr.html#Ogre_1_1TexturePtra1">00310</a> <span class="keyword">explicit</span> TexturePtr(Texture* rep) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Texture>(rep) {} |
---|
190 | <a name="l00311"></a><a class="code" href="classOgre_1_1TexturePtr.html#Ogre_1_1TexturePtra2">00311</a> TexturePtr(<span class="keyword">const</span> TexturePtr& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><Texture>(r) {} |
---|
191 | <a name="l00312"></a><a class="code" href="classOgre_1_1TexturePtr.html#Ogre_1_1TexturePtra3">00312</a> TexturePtr(<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><Texture>() |
---|
192 | 00313 { |
---|
193 | 00314 <span class="comment">// lock & copy other mutex pointer</span> |
---|
194 | 00315 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
195 | 00316 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
196 | 00317 pRep = static_cast<Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
197 | 00318 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
198 | 00319 <span class="keywordflow">if</span> (pUseCount) |
---|
199 | 00320 { |
---|
200 | 00321 ++(*pUseCount); |
---|
201 | 00322 } |
---|
202 | 00323 } |
---|
203 | 00324 |
---|
204 | <a name="l00326"></a><a class="code" href="classOgre_1_1TexturePtr.html#Ogre_1_1TexturePtra4">00326</a> TexturePtr& operator=(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>& r) |
---|
205 | 00327 { |
---|
206 | 00328 <span class="keywordflow">if</span> (pRep == static_cast<Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
207 | 00329 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
208 | 00330 release(); |
---|
209 | 00331 <span class="comment">// lock & copy other mutex pointer</span> |
---|
210 | 00332 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
211 | 00333 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
212 | 00334 pRep = static_cast<Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
213 | 00335 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
214 | 00336 <span class="keywordflow">if</span> (pUseCount) |
---|
215 | 00337 { |
---|
216 | 00338 ++(*pUseCount); |
---|
217 | 00339 } |
---|
218 | 00340 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
219 | 00341 } |
---|
220 | 00342 }; |
---|
221 | 00343 |
---|
222 | 00344 } |
---|
223 | 00345 |
---|
224 | 00346 <span class="preprocessor">#endif</span> |
---|
225 | </pre></div><hr> |
---|
226 | <p> |
---|
227 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
228 | <!--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/> |
---|
229 | 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/> |
---|
230 | <!--/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#"> |
---|
231 | <Work rdf:about=""> |
---|
232 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
233 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
234 | </Work> |
---|
235 | <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> --> |
---|
236 | |
---|
237 | Last modified Sun Mar 12 14:37:51 2006 |
---|
238 | </p> |
---|
239 | </body> |
---|
240 | </html> |
---|