source: OGRE/trunk/ogrenew/Docs/api/html/OgreD3D9Texture_8h-source.html @ 657

Revision 657, 32.1 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1<html>
2<head>
3<title>OgreD3D9Texture.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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
10<h1>OgreD3D9Texture.h</h1><a href="OgreD3D9Texture_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>
1100002 <span class="comment">-----------------------------------------------------------------------------</span>
1200003 <span class="comment">This source file is part of OGRE</span>
1300004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
1400005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
1500006 <span class="comment"></span>
1600007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
1700008 <span class="comment">Also see acknowledgements in Readme.html</span>
1800009 <span class="comment"></span>
1900010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
2000011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
2100012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
2200013 <span class="comment">version.</span>
2300014 <span class="comment"></span>
2400015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
2500016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
2600017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
2700018 <span class="comment"></span>
2800019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
2900020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
3000021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
3100022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
3200023 <span class="comment">-----------------------------------------------------------------------------</span>
3300024 <span class="comment">*/</span>
3400025 <span class="preprocessor">#ifndef __D3D8TEXTURE_H__</span>
3500026 <span class="preprocessor"></span><span class="preprocessor">#define __D3D8TEXTURE_H__</span>
3600027 <span class="preprocessor"></span>
3700028 <span class="preprocessor">#include "<a class="code" href="OgreD3D9Prerequisites_8h.html">OgreD3D9Prerequisites.h</a>"</span>
3800029 <span class="preprocessor">#include "<a class="code" href="OgreTexture_8h.html">OgreTexture.h</a>"</span>
3900030 <span class="preprocessor">#include "<a class="code" href="OgreRenderTexture_8h.html">OgreRenderTexture.h</a>"</span>
4000031 <span class="preprocessor">#include "<a class="code" href="OgreImage_8h.html">OgreImage.h</a>"</span>
4100032 <span class="preprocessor">#include "<a class="code" href="OgreException_8h.html">OgreException.h</a>"</span>
4200033 <span class="preprocessor">#include "<a class="code" href="OgreD3D9HardwarePixelBuffer_8h.html">OgreD3D9HardwarePixelBuffer.h</a>"</span>
4300034
4400035 <span class="preprocessor">#include "<a class="code" href="OgreNoMemoryMacros_8h.html">OgreNoMemoryMacros.h</a>"</span>
4500036 <span class="preprocessor">#include &lt;d3d9.h&gt;</span>
4600037 <span class="preprocessor">#include &lt;d3dx9.h&gt;</span>
4700038 <span class="preprocessor">#include &lt;dxerr9.h&gt;</span>
4800039 <span class="preprocessor">#include "<a class="code" href="OgreMemoryMacros_8h.html">OgreMemoryMacros.h</a>"</span>
4900040
5000041 <span class="keyword">namespace </span>Ogre {
51<a name="l00042"></a><a class="code" href="classOgre_1_1D3D9Texture.html">00042</a>     <span class="keyword">class </span><a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a> : <span class="keyword">public</span> <a class="code" href="classOgre_1_1Texture.html">Texture</a>
5200043     {
5300044     <span class="keyword">protected</span>:
54<a name="l00046"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep0">00046</a>         IDirect3DDevice9        *mpDev;     
55<a name="l00048"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep1">00048</a>         IDirect3D9              *mpD3D;
56<a name="l00050"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep2">00050</a>         IDirect3DTexture9       *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep2">mpNormTex</a>;
57<a name="l00052"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep3">00052</a>         IDirect3DCubeTexture9   *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep3">mpCubeTex</a>;
58<a name="l00054"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep4">00054</a>         IDirect3DVolumeTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep4">mpVolumeTex</a>;
59<a name="l00056"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">00056</a>         IDirect3DSurface9       *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">mpZBuff</a>;   
60<a name="l00058"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">00058</a>         IDirect3DBaseTexture9   *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">mpTex</a>;     
6100059
62<a name="l00061"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep7">00061</a>         <a class="code" href="namespaceOgre.html#a426">String</a>                          mCubeFaceNames[6];
63<a name="l00063"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep8">00063</a>         D3DDEVICE_CREATION_PARAMETERS   <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep8">mDevCreParams</a>;
64<a name="l00065"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep9">00065</a>         D3DFORMAT                       <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep9">mBBPixelFormat</a>;
65<a name="l00067"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep10">00067</a>         D3DPOOL                         mD3DPool;
66<a name="l00069"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep11">00069</a>         D3DCAPS9                        <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep11">mDevCaps</a>;
6700070         <span class="comment">// Dynamic textures?</span>
68<a name="l00071"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep12">00071</a>         <span class="keywordtype">bool</span>                            <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep12">mDynamicTextures</a>;
69<a name="l00073"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturex0">00073</a>         <span class="keyword">typedef</span> std::vector&lt;HardwarePixelBufferSharedPtr&gt; SurfaceList;
70<a name="l00074"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep13">00074</a>         SurfaceList                     mSurfaceList;
7100075     
7200077         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb0">_initDevice</a>(<span class="keywordtype">void</span>);
7300079         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb1">_loadCubeTex</a>();
7400081         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb2">_loadNormTex</a>();
7500083         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb3">_loadVolumeTex</a>();
7600084
7700086         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb4">_createNormTex</a>();
7800088         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb5">_createCubeTex</a>();
7900090         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb6">_createVolumeTex</a>();
8000091
8100093         D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb7">_chooseD3DFormat</a>();
8200094
8300096         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb8">createInternalResourcesImpl</a>(<span class="keywordtype">void</span>);
8400098         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb9">freeInternalResourcesImpl</a>(<span class="keywordtype">void</span>);
8500100         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb10">_setSrcAttributes</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> height, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> depth, PixelFormat format);
8600102         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb11">_setFinalAttributes</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> height, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> depth, PixelFormat format);
8700104         D3DTEXTUREFILTERTYPE <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb12">_getBestFilterMethod</a>();
8800106         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb13">_canUseDynamicTextures</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat);
8900108         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb14">_canAutoGenMipmaps</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat);
9000110         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb15">_createDepthStencil</a>();
9100111
92<a name="l00113"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb16">00113</a>         <a class="code" href="namespaceOgre.html#a426">String</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb16">_getCubeFaceName</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> face)<span class="keyword"> const</span>
9300114 <span class="keyword">        </span>{ assert(face &lt; 6); <span class="keywordflow">return</span> mCubeFaceNames[face]; }
9400115         
9500118         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb17">_createSurfaceList</a>(<span class="keywordtype">void</span>);
9600119
9700121         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb18">loadImpl</a>();
9800122     <span class="keyword">public</span>:
9900124         <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea0">D3D9Texture</a>(<a class="code" href="classOgre_1_1ResourceManager.html">ResourceManager</a>* creator, <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; name, <a class="code" href="namespaceOgre.html#a485">ResourceHandle</a> handle,
10000125             <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; group, <span class="keywordtype">bool</span> isManual, <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a>* loader,
10100126             IDirect3DDevice9 *pD3DDevice);
10200128         <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea1">~D3D9Texture</a>();
10300129
10400131         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea2">copyToTexture</a>( <a class="code" href="classOgre_1_1TexturePtr.html">TexturePtr</a>&amp; target );
10500133         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea3">loadImage</a>( <span class="keyword">const</span> <a class="code" href="classOgre_1_1Image.html">Image</a> &amp;img );
10600134
10700135
10800137         <a class="code" href="classOgre_1_1HardwarePixelBufferSharedPtr.html">HardwarePixelBufferSharedPtr</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea4">getBuffer</a>(size_t face, size_t mipmap);
10900138         
110<a name="l00140"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea5">00140</a>         IDirect3DBaseTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea5">getTexture</a>()
11100141         { assert(<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">mpTex</a>); <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">mpTex</a>; }
112<a name="l00143"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea6">00143</a>         IDirect3DTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea6">getNormTexture</a>()
11300144         { assert(<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep2">mpNormTex</a>); <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep2">mpNormTex</a>; }
114<a name="l00146"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea7">00146</a>         IDirect3DCubeTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea7">getCubeTexture</a>()
11500147         { assert(<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep3">mpCubeTex</a>); <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep3">mpCubeTex</a>; }
116<a name="l00149"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea8">00149</a>         IDirect3DSurface9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea8">getDepthStencil</a>()
11700150         { assert(<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">mpZBuff</a>); <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">mpZBuff</a>; }
11800151         
11900153         <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a667">PixelFormat</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee0">_getPF</a>(D3DFORMAT d3dPF);
12000155         <span class="keyword">static</span> D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee0">_getPF</a>(PixelFormat ogrePF);
12100157         <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a667">PixelFormat</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee2">_getClosestSupportedPF</a>(PixelFormat ogrePF);
12200158
12300160         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea9">releaseIfDefaultPool</a>(<span class="keywordtype">void</span>);
12400162         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea10">recreateIfDefaultPool</a>(LPDIRECT3DDEVICE9 pDev);
12500163
12600164     };
12700165
128<a name="l00172"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html">00172</a>     <span class="keyword">class </span><a class="code" href="classOgre_1_1D3D9TexturePtr.html">D3D9TexturePtr</a> : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a>&lt;D3D9Texture&gt;
12900173     {
13000174     <span class="keyword">public</span>:
131<a name="l00175"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">00175</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">D3D9TexturePtr</a>() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a>&lt;<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>&gt;() {}
132<a name="l00176"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra1">00176</a>         <span class="keyword">explicit</span> <a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">D3D9TexturePtr</a>(<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>* rep) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a>&lt;<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>&gt;(rep) {}
133<a name="l00177"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra2">00177</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">D3D9TexturePtr</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1D3D9TexturePtr.html">D3D9TexturePtr</a>&amp; r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a>&lt;<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>&gt;(r) {}
134<a name="l00178"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra3">00178</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">D3D9TexturePtr</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>&amp; r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a>&lt;<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>&gt;()
13500179         {
13600180             <span class="comment">// lock &amp; copy other mutex pointer</span>
13700181             <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME)
13800182             <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME)
13900183             pRep = static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>());
14000184             pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>();
14100185             <span class="keywordflow">if</span> (pUseCount)
14200186             {
14300187                 ++(*pUseCount);
14400188             }
14500189         }
14600190
147<a name="l00192"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra4">00192</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html">D3D9TexturePtr</a>&amp; <a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra4">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1SharedPtr.html">ResourcePtr</a>&amp; r)
14800193         {
14900194             <span class="keywordflow">if</span> (pRep == static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()))
15000195                 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
15100196             <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>();
15200197             <span class="comment">// lock &amp; copy other mutex pointer</span>
15300198             <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME)
15400199             <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME)
15500200             pRep = static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>());
15600201             pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>();
15700202             <span class="keywordflow">if</span> (pUseCount)
15800203             {
15900204                 ++(*pUseCount);
16000205             }
16100206             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
16200207         }
163<a name="l00209"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra5">00209</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html">D3D9TexturePtr</a>&amp; <a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra4">operator=</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1TexturePtr.html">TexturePtr</a>&amp; r)
16400210         {
16500211             <span class="keywordflow">if</span> (pRep == static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()))
16600212                 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
16700213             <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>();
16800214             <span class="comment">// lock &amp; copy other mutex pointer</span>
16900215             <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME)
17000216             <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME)
17100217             pRep = static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>());
17200218             pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>();
17300219             <span class="keywordflow">if</span> (pUseCount)
17400220             {
17500221                 ++(*pUseCount);
17600222             }
17700223             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
17800224         }
17900225     };
18000226
18100227
182<a name="l00229"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html">00229</a>     <span class="keyword">class </span><a class="code" href="classOgre_1_1D3D9RenderTexture.html">D3D9RenderTexture</a> : <span class="keyword">public</span> <a class="code" href="classOgre_1_1RenderTexture.html">RenderTexture</a>
18300230     {
18400231     <span class="keyword">public</span>:
185<a name="l00232"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea0">00232</a>         <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea0">D3D9RenderTexture</a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a> &amp; name,
18600233             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height,
18700234             TextureType texType, PixelFormat internalFormat,
18800235             <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a62">NameValuePairList</a> *miscParams )
18900236             : <a class="code" href="classOgre_1_1RenderTexture.html">RenderTexture</a>( name, width, height, texType, internalFormat )
19000237         {
19100238             mPrivateTex = TextureManager::getSingleton().createManual
19200239                 (mName + <span class="stringliteral">"_PRIVATE##"</span>, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
19300240                 texType, mWidth, mHeight, 0, internalFormat, <a class="code" href="namespaceOgre.html#a680a544">TU_RENDERTARGET</a> );
19400241             mPrivateTex-&gt;load();
19500242         }
19600243         
197<a name="l00244"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea1">00244</a>         <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea1">~D3D9RenderTexture</a>()
19800245         {
19900246             mPrivateTex-&gt;unload();
20000247             TextureManager::getSingleton().remove(mPrivateTex-&gt;getName());
20100248             
20200249         }
20300250
204<a name="l00251"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea2">00251</a>         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea2">getCustomAttribute</a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>&amp; name, <span class="keywordtype">void</span> *pData )
20500252         {
20600253             <span class="keywordflow">if</span>( name == <span class="stringliteral">"DDBACKBUFFER"</span> )
20700254             {
20800255                 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
20900256                 <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a681a547">TEX_TYPE_2D</a>)
21000257                     mPrivateTex-&gt;getNormTexture()-&gt;GetSurfaceLevel( 0, &amp;(*pSurf) );
21100258                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a681a549">TEX_TYPE_CUBE_MAP</a>)
21200259                     mPrivateTex-&gt;getCubeTexture()-&gt;GetCubeMapSurface( (D3DCUBEMAP_FACES)0, 0, &amp;(*pSurf) );
21300260                 <span class="keywordflow">else</span>
21400261                 {
21500262                     <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>( Exception::UNIMPLEMENTED_FEATURE,
21600263                             <span class="stringliteral">"getCustomAttribute is implemented only for 2D and cube textures !!!"</span>,
21700264                             <span class="stringliteral">"D3D9RenderTexture::getCustomAttribute"</span> );
21800265                 }
21900266                 <span class="comment">// decrement reference count</span>
22000267                 (*pSurf)-&gt;Release();
22100268                 <span class="keywordflow">return</span>;
22200269             }
22300270             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"D3DZBUFFER"</span> )
22400271             {
22500272                 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
22600273                 *pSurf = mPrivateTex-&gt;getDepthStencil();
22700274                 <span class="keywordflow">return</span>;
22800275             }
22900276             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"DDFRONTBUFFER"</span> )
23000277             {
23100278                 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
23200279                 <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a681a547">TEX_TYPE_2D</a>)
23300280                     mPrivateTex-&gt;getNormTexture()-&gt;GetSurfaceLevel( 0, &amp;(*pSurf) );
23400281                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a681a549">TEX_TYPE_CUBE_MAP</a>)
23500282                     mPrivateTex-&gt;getCubeTexture()-&gt;GetCubeMapSurface( (D3DCUBEMAP_FACES)0, 0, &amp;(*pSurf) );
23600283                 <span class="keywordflow">else</span>
23700284                 {
23800285                     <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>( Exception::UNIMPLEMENTED_FEATURE,
23900286                             <span class="stringliteral">"getCustomAttribute is implemented only for 2D and cube textures !!!"</span>,
24000287                             <span class="stringliteral">"D3D9RenderTexture::getCustomAttribute"</span> );
24100288                 }
24200289                 (*pSurf)-&gt;Release();
24300290                 <span class="keywordflow">return</span>;
24400291             }
24500292             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"HWND"</span> )
24600293             {
24700294                 HWND *pHwnd = (HWND*)pData;
24800295                 *pHwnd = NULL;
24900296                 <span class="keywordflow">return</span>;
25000297             }
25100298             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"isTexture"</span> )
25200299             {
25300300                 <span class="keywordtype">bool</span> *b = reinterpret_cast&lt; bool * &gt;( pData );
25400301                 *b = <span class="keyword">true</span>;
25500302                 <span class="keywordflow">return</span>;
25600303             }
25700304         }
25800305
259<a name="l00306"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea3">00306</a>         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea3">requiresTextureFlipping</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; }
260<a name="l00307"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea4">00307</a>         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea4">writeContentsToFile</a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a> &amp; filename ) {}
26100308
26200309     <span class="keyword">protected</span>:
263<a name="l00311"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturep0">00311</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html">D3D9TexturePtr</a> mPrivateTex;
26400312         
265<a name="l00313"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTextureb0">00313</a>         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTextureb0">_copyToTexture</a>()
26600314         {
26700315             <span class="comment">// Copy the newly-rendered data to the public texture surface.</span>
26800316             mPrivateTex-&gt;copyToTexture( mTexture );
26900317         }
27000318     };
27100319 }
27200320
27300321 <span class="preprocessor">#endif</span>
274</pre></div><hr>
275<p>
276Copyright &copy; 2000-2005 by The OGRE Team<br />
277<!--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/>
278This 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/>
279                <!--/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#">
280                <Work rdf:about="">
281                        <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" />
282        <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" />
283                </Work>
284                <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> -->
285
286Last modified Sun Feb 12 12:59:44 2006
287</p>
288</body>
289</html>
Note: See TracBrowser for help on using the repository browser.