Sophie

Sophie

distrib > Mandriva > 10.2 > i586 > media > contrib > by-pkgid > 04e5d8c10ae76748689b4e7f48e0fa33 > files > 398

libogre5-devel-1.0.0-1mdk.i586.rpm

<html>
<head>
<title>OgreD3D9Texture.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
<link type="text/css" rel="stylesheet" href="style.css">
</head>

<body>
<!-- Generated by Doxygen 1.3.6 -->
<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>
<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>
00002 <span class="comment">-----------------------------------------------------------------------------</span>
00003 <span class="comment">This source file is part of OGRE</span>
00004 <span class="comment">    (Object-oriented Graphics Rendering Engine)</span>
00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span>
00006 <span class="comment"></span>
00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span>
00008 <span class="comment">Also see acknowledgements in Readme.html</span>
00009 <span class="comment"></span>
00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span>
00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span>
00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span>
00013 <span class="comment">version.</span>
00014 <span class="comment"></span>
00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span>
00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span>
00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span>
00018 <span class="comment"></span>
00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span>
00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span>
00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span>
00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span>
00023 <span class="comment">-----------------------------------------------------------------------------</span>
00024 <span class="comment">*/</span>
00025 <span class="preprocessor">#ifndef __D3D8TEXTURE_H__</span>
00026 <span class="preprocessor"></span><span class="preprocessor">#define __D3D8TEXTURE_H__</span>
00027 <span class="preprocessor"></span>
00028 <span class="preprocessor">#include "<a class="code" href="OgreD3D9Prerequisites_8h.html">OgreD3D9Prerequisites.h</a>"</span>
00029 <span class="preprocessor">#include "<a class="code" href="OgreTexture_8h.html">OgreTexture.h</a>"</span>
00030 <span class="preprocessor">#include "<a class="code" href="OgreRenderTexture_8h.html">OgreRenderTexture.h</a>"</span>
00031 <span class="preprocessor">#include "<a class="code" href="OgreImage_8h.html">OgreImage.h</a>"</span>
00032 <span class="preprocessor">#include "<a class="code" href="OgreException_8h.html">OgreException.h</a>"</span>
00033 <span class="preprocessor">#include "<a class="code" href="OgreD3D9HardwarePixelBuffer_8h.html">OgreD3D9HardwarePixelBuffer.h</a>"</span>
00034 
00035 <span class="preprocessor">#include "<a class="code" href="OgreNoMemoryMacros_8h.html">OgreNoMemoryMacros.h</a>"</span>
00036 <span class="preprocessor">#include &lt;d3d9.h&gt;</span>
00037 <span class="preprocessor">#include &lt;d3dx9.h&gt;</span>
00038 <span class="preprocessor">#include &lt;dxerr9.h&gt;</span>
00039 <span class="preprocessor">#include "<a class="code" href="OgreMemoryMacros_8h.html">OgreMemoryMacros.h</a>"</span>
00040 
00041 <span class="keyword">namespace </span>Ogre {
<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>
00043     {
00044     <span class="keyword">protected</span>:
<a name="l00046"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep0">00046</a>         IDirect3DDevice9        *mpDev;     
<a name="l00048"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep1">00048</a>         IDirect3D9              *mpD3D;
<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>; 
<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>; 
<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>;
<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>;   
<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>;     
00059 
<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];
<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>;
<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>;
<a name="l00067"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep10">00067</a>         D3DPOOL                         mD3DPool;
<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>;
00070         <span class="comment">// Auto-generated mipmaps?</span>
<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">mAutoGenMipmaps</a>;
00072         <span class="comment">// Dynamic textures?</span>
<a name="l00073"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep13">00073</a>         <span class="keywordtype">bool</span>                            <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep13">mDynamicTextures</a>;
<a name="l00075"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturex0">00075</a>         <span class="keyword">typedef</span> std::vector&lt;HardwarePixelBufferSharedPtr&gt; SurfaceList;
<a name="l00076"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep14">00076</a>         SurfaceList                     mSurfaceList;
00077     
00079         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb0">_initDevice</a>(<span class="keywordtype">void</span>);
00081         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb1">_loadCubeTex</a>();
00083         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb2">_loadNormTex</a>();
00085         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb3">_loadVolumeTex</a>();
00086 
00088         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb4">_createNormTex</a>();
00090         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb5">_createCubeTex</a>();
00092         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb6">_createVolumeTex</a>();
00093 
00095         D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb7">_chooseD3DFormat</a>();
00096 
00098         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb8">_freeResources</a>();
00100         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb9">_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);
00102         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb10">_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);
00104         D3DTEXTUREFILTERTYPE <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb11">_getBestFilterMethod</a>();
00106         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb12">_canUseDynamicTextures</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat);
00108         <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb13">_canAutoGenMipmaps</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat);
00110         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb14">_createDepthStencil</a>();
00111 
<a name="l00113"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb15">00113</a>         <a class="code" href="namespaceOgre.html#a426">String</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb15">_getCubeFaceName</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> face)<span class="keyword"> const</span>
00114 <span class="keyword">        </span>{ assert(face &lt; 6); <span class="keywordflow">return</span> mCubeFaceNames[face]; }
00115         
00118         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb16">_createSurfaceList</a>(<span class="keywordtype">bool</span> updateOldList=<span class="keyword">false</span>);
00119 
00121         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb17">loadImpl</a>();
00123         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb18">unloadImpl</a>();
00124     <span class="keyword">public</span>:
00126         <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,
00127             <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, 
00128             IDirect3DDevice9 *pD3DDevice);
00130         <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea1">~D3D9Texture</a>();
00131 
00133         <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 );
00135         <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 );
00136 
00138         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea4">createInternalResources</a>(<span class="keywordtype">void</span>);
00139 
00141         <a class="code" href="classOgre_1_1HardwarePixelBufferSharedPtr.html">HardwarePixelBufferSharedPtr</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea5">getBuffer</a>(size_t face, size_t mipmap);
00142         
<a name="l00144"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea6">00144</a>         IDirect3DBaseTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea6">getTexture</a>() 
00145         { 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>; }
<a name="l00147"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea7">00147</a>         IDirect3DTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea7">getNormTexture</a>()
00148         { 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>; }
<a name="l00150"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea8">00150</a>         IDirect3DCubeTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea8">getCubeTexture</a>()
00151         { 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>; }
<a name="l00153"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea9">00153</a>         IDirect3DSurface9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea9">getDepthStencil</a>() 
00154         { 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>; }
00155         
00157         <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a666">PixelFormat</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee0">_getPF</a>(D3DFORMAT d3dPF);
00159         <span class="keyword">static</span> D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee0">_getPF</a>(PixelFormat ogrePF);
00161         <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a666">PixelFormat</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee2">_getClosestSupportedPF</a>(PixelFormat ogrePF);
00162 
00164         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea10">releaseIfDefaultPool</a>(<span class="keywordtype">void</span>);
00166         <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea11">recreateIfDefaultPool</a>(LPDIRECT3DDEVICE9 pDev);
00167 
00168     };
00169 
<a name="l00176"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html">00176</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; 
00177     {
00178     <span class="keyword">public</span>:
<a name="l00179"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">00179</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;() {}
<a name="l00180"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra1">00180</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) {}
<a name="l00181"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra2">00181</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) {} 
<a name="l00182"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra3">00182</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;()
00183         {
00184             <span class="comment">// lock &amp; copy other mutex pointer</span>
00185             <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME)
00186             <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME)
00187             pRep = static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>());
00188             pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>();
00189             <span class="keywordflow">if</span> (pUseCount)
00190             {
00191                 ++(*pUseCount);
00192             }
00193         }
00194 
<a name="l00196"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra4">00196</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)
00197         {
00198             <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>()))
00199                 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00200             <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>();
00201             <span class="comment">// lock &amp; copy other mutex pointer</span>
00202             <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME)
00203             <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME)
00204             pRep = static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>());
00205             pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>();
00206             <span class="keywordflow">if</span> (pUseCount)
00207             {
00208                 ++(*pUseCount);
00209             }
00210             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00211         }
<a name="l00213"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra5">00213</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)
00214         {
00215             <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>()))
00216                 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00217             <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>();
00218             <span class="comment">// lock &amp; copy other mutex pointer</span>
00219             <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME)
00220             <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME)
00221             pRep = static_cast&lt;D3D9Texture*&gt;(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>());
00222             pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>();
00223             <span class="keywordflow">if</span> (pUseCount)
00224             {
00225                 ++(*pUseCount);
00226             }
00227             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00228         }
00229     };
00230 
00231 
<a name="l00233"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html">00233</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>
00234     {
00235     <span class="keyword">public</span>:
<a name="l00236"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea0">00236</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, 
00237             <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height,
00238             TextureType texType, PixelFormat internalFormat, 
00239             <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a62">NameValuePairList</a> *miscParams ) 
00240             : <a class="code" href="classOgre_1_1RenderTexture.html">RenderTexture</a>( name, width, height, texType, internalFormat )
00241         {
00242             mPrivateTex = TextureManager::getSingleton().createManual
00243                 (mName + <span class="stringliteral">"_PRIVATE##"</span>, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, 
00244                 texType, mWidth, mHeight, 0, internalFormat, <a class="code" href="namespaceOgre.html#a679a543">TU_RENDERTARGET</a> );
00245         }
00246         
<a name="l00247"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea1">00247</a>         <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea1">~D3D9RenderTexture</a>()
00248         {
00249             mPrivateTex-&gt;unload();
00250             TextureManager::getSingleton().remove(mPrivateTex-&gt;getName());
00251             
00252         }
00253 
<a name="l00254"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea2">00254</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 )
00255         {
00256             <span class="keywordflow">if</span>( name == <span class="stringliteral">"DDBACKBUFFER"</span> )
00257             {
00258                 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
00259                 <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a680a546">TEX_TYPE_2D</a>)
00260                     mPrivateTex-&gt;getNormTexture()-&gt;GetSurfaceLevel( 0, &amp;(*pSurf) );
00261                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a680a548">TEX_TYPE_CUBE_MAP</a>)
00262                     mPrivateTex-&gt;getCubeTexture()-&gt;GetCubeMapSurface( (D3DCUBEMAP_FACES)0, 0, &amp;(*pSurf) );
00263                 <span class="keywordflow">else</span>
00264                 {
00265                     <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>( Exception::UNIMPLEMENTED_FEATURE, 
00266                             <span class="stringliteral">"getCustomAttribute is implemented only for 2D and cube textures !!!"</span>, 
00267                             <span class="stringliteral">"D3D9RenderTexture::getCustomAttribute"</span> );
00268                 }
00269                 <span class="comment">// decrement reference count</span>
00270                 (*pSurf)-&gt;Release();
00271                 <span class="keywordflow">return</span>;
00272             }
00273             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"D3DZBUFFER"</span> )
00274             {
00275                 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
00276                 *pSurf = mPrivateTex-&gt;getDepthStencil();
00277                 <span class="keywordflow">return</span>;
00278             }
00279             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"DDFRONTBUFFER"</span> )
00280             {
00281                 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData;
00282                 <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a680a546">TEX_TYPE_2D</a>)
00283                     mPrivateTex-&gt;getNormTexture()-&gt;GetSurfaceLevel( 0, &amp;(*pSurf) );
00284                 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mPrivateTex-&gt;getTextureType() == <a class="code" href="namespaceOgre.html#a680a548">TEX_TYPE_CUBE_MAP</a>)
00285                     mPrivateTex-&gt;getCubeTexture()-&gt;GetCubeMapSurface( (D3DCUBEMAP_FACES)0, 0, &amp;(*pSurf) );
00286                 <span class="keywordflow">else</span>
00287                 {
00288                     <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>( Exception::UNIMPLEMENTED_FEATURE, 
00289                             <span class="stringliteral">"getCustomAttribute is implemented only for 2D and cube textures !!!"</span>, 
00290                             <span class="stringliteral">"D3D9RenderTexture::getCustomAttribute"</span> );
00291                 }
00292                 (*pSurf)-&gt;Release();
00293                 <span class="keywordflow">return</span>;
00294             }
00295             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"HWND"</span> )
00296             {
00297                 HWND *pHwnd = (HWND*)pData;
00298                 *pHwnd = NULL;
00299                 <span class="keywordflow">return</span>;
00300             }
00301             <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"isTexture"</span> )
00302             {
00303                 <span class="keywordtype">bool</span> *b = reinterpret_cast&lt; bool * &gt;( pData );
00304                 *b = <span class="keyword">true</span>;
00305                 <span class="keywordflow">return</span>;
00306             }
00307         }
00308 
<a name="l00309"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea3">00309</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>; }
<a name="l00310"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea4">00310</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 ) {}
00311 
00312     <span class="keyword">protected</span>:
<a name="l00314"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturep0">00314</a>         <a class="code" href="classOgre_1_1D3D9TexturePtr.html">D3D9TexturePtr</a> mPrivateTex;
00315         
<a name="l00316"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTextureb0">00316</a>         <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTextureb0">_copyToTexture</a>()
00317         {
00318             <span class="comment">// Copy the newly-rendered data to the public texture surface.</span>
00319             mPrivateTex-&gt;copyToTexture( mTexture );
00320         }
00321     };
00322 }
00323 
00324 <span class="preprocessor">#endif</span>
</pre></div><p>
Copyright &copy; 2000-2005 by The OGRE Team<br />
Last modified Wed Feb 23 00:19:05 2005
</p>
</body>
</html>