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 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>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> |
---|
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 __D3D8TEXTURE_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __D3D8TEXTURE_H__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="preprocessor">#include "<a class="code" href="OgreD3D9Prerequisites_8h.html">OgreD3D9Prerequisites.h</a>"</span> |
---|
38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgreTexture_8h.html">OgreTexture.h</a>"</span> |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreRenderTexture_8h.html">OgreRenderTexture.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreImage_8h.html">OgreImage.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreException_8h.html">OgreException.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreD3D9HardwarePixelBuffer_8h.html">OgreD3D9HardwarePixelBuffer.h</a>"</span> |
---|
43 | 00034 |
---|
44 | 00035 <span class="preprocessor">#include "<a class="code" href="OgreNoMemoryMacros_8h.html">OgreNoMemoryMacros.h</a>"</span> |
---|
45 | 00036 <span class="preprocessor">#include <d3d9.h></span> |
---|
46 | 00037 <span class="preprocessor">#include <d3dx9.h></span> |
---|
47 | 00038 <span class="preprocessor">#include <dxerr9.h></span> |
---|
48 | 00039 <span class="preprocessor">#include "<a class="code" href="OgreMemoryMacros_8h.html">OgreMemoryMacros.h</a>"</span> |
---|
49 | 00040 |
---|
50 | 00041 <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> |
---|
52 | 00043 { |
---|
53 | 00044 <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>; |
---|
61 | 00059 |
---|
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>; |
---|
67 | 00070 <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<HardwarePixelBufferSharedPtr> SurfaceList; |
---|
70 | <a name="l00074"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep13">00074</a> SurfaceList mSurfaceList; |
---|
71 | 00075 |
---|
72 | 00077 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb0">_initDevice</a>(<span class="keywordtype">void</span>); |
---|
73 | 00079 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb1">_loadCubeTex</a>(); |
---|
74 | 00081 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb2">_loadNormTex</a>(); |
---|
75 | 00083 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb3">_loadVolumeTex</a>(); |
---|
76 | 00084 |
---|
77 | 00086 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb4">_createNormTex</a>(); |
---|
78 | 00088 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb5">_createCubeTex</a>(); |
---|
79 | 00090 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb6">_createVolumeTex</a>(); |
---|
80 | 00091 |
---|
81 | 00093 D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb7">_chooseD3DFormat</a>(); |
---|
82 | 00094 |
---|
83 | 00096 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb8">createInternalResourcesImpl</a>(<span class="keywordtype">void</span>); |
---|
84 | 00098 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb9">freeInternalResourcesImpl</a>(<span class="keywordtype">void</span>); |
---|
85 | 00100 <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); |
---|
86 | 00102 <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); |
---|
87 | 00104 D3DTEXTUREFILTERTYPE <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb12">_getBestFilterMethod</a>(); |
---|
88 | 00106 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb13">_canUseDynamicTextures</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat); |
---|
89 | 00108 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb14">_canAutoGenMipmaps</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat); |
---|
90 | 00110 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb15">_createDepthStencil</a>(); |
---|
91 | 00111 |
---|
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> |
---|
93 | 00114 <span class="keyword"> </span>{ assert(face < 6); <span class="keywordflow">return</span> mCubeFaceNames[face]; } |
---|
94 | 00115 |
---|
95 | 00118 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb17">_createSurfaceList</a>(<span class="keywordtype">void</span>); |
---|
96 | 00119 |
---|
97 | 00121 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb18">loadImpl</a>(); |
---|
98 | 00122 <span class="keyword">public</span>: |
---|
99 | 00124 <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>& name, <a class="code" href="namespaceOgre.html#a485">ResourceHandle</a> handle, |
---|
100 | 00125 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a426">String</a>& group, <span class="keywordtype">bool</span> isManual, <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a>* loader, |
---|
101 | 00126 IDirect3DDevice9 *pD3DDevice); |
---|
102 | 00128 <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea1">~D3D9Texture</a>(); |
---|
103 | 00129 |
---|
104 | 00131 <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>& target ); |
---|
105 | 00133 <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> &img ); |
---|
106 | 00134 |
---|
107 | 00135 |
---|
108 | 00137 <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); |
---|
109 | 00138 |
---|
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>() |
---|
111 | 00141 { 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>() |
---|
113 | 00144 { 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>() |
---|
115 | 00147 { 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>() |
---|
117 | 00150 { 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>; } |
---|
118 | 00151 |
---|
119 | 00153 <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); |
---|
120 | 00155 <span class="keyword">static</span> D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturee0">_getPF</a>(PixelFormat ogrePF); |
---|
121 | 00157 <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); |
---|
122 | 00158 |
---|
123 | 00160 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea9">releaseIfDefaultPool</a>(<span class="keywordtype">void</span>); |
---|
124 | 00162 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea10">recreateIfDefaultPool</a>(LPDIRECT3DDEVICE9 pDev); |
---|
125 | 00163 |
---|
126 | 00164 }; |
---|
127 | 00165 |
---|
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><D3D9Texture> |
---|
129 | 00173 { |
---|
130 | 00174 <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><<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>>() {} |
---|
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><<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>>(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>& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>>(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>& r) : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><<a class="code" href="classOgre_1_1D3D9Texture.html">D3D9Texture</a>>() |
---|
135 | 00179 { |
---|
136 | 00180 <span class="comment">// lock & copy other mutex pointer</span> |
---|
137 | 00181 <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
138 | 00182 <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
139 | 00183 pRep = static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
140 | 00184 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
141 | 00185 <span class="keywordflow">if</span> (pUseCount) |
---|
142 | 00186 { |
---|
143 | 00187 ++(*pUseCount); |
---|
144 | 00188 } |
---|
145 | 00189 } |
---|
146 | 00190 |
---|
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>& <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>& r) |
---|
148 | 00193 { |
---|
149 | 00194 <span class="keywordflow">if</span> (pRep == static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
150 | 00195 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
151 | 00196 <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>(); |
---|
152 | 00197 <span class="comment">// lock & copy other mutex pointer</span> |
---|
153 | 00198 <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
154 | 00199 <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
155 | 00200 pRep = static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
156 | 00201 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
157 | 00202 <span class="keywordflow">if</span> (pUseCount) |
---|
158 | 00203 { |
---|
159 | 00204 ++(*pUseCount); |
---|
160 | 00205 } |
---|
161 | 00206 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
162 | 00207 } |
---|
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>& <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>& r) |
---|
164 | 00210 { |
---|
165 | 00211 <span class="keywordflow">if</span> (pRep == static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
166 | 00212 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
167 | 00213 <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>(); |
---|
168 | 00214 <span class="comment">// lock & copy other mutex pointer</span> |
---|
169 | 00215 <a class="code" href="OgrePrerequisites_8h.html#a14">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
170 | 00216 <a class="code" href="OgrePrerequisites_8h.html#a19">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
171 | 00217 pRep = static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
172 | 00218 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
173 | 00219 <span class="keywordflow">if</span> (pUseCount) |
---|
174 | 00220 { |
---|
175 | 00221 ++(*pUseCount); |
---|
176 | 00222 } |
---|
177 | 00223 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
178 | 00224 } |
---|
179 | 00225 }; |
---|
180 | 00226 |
---|
181 | 00227 |
---|
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> |
---|
183 | 00230 { |
---|
184 | 00231 <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> & name, |
---|
186 | 00233 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height, |
---|
187 | 00234 TextureType texType, PixelFormat internalFormat, |
---|
188 | 00235 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a62">NameValuePairList</a> *miscParams ) |
---|
189 | 00236 : <a class="code" href="classOgre_1_1RenderTexture.html">RenderTexture</a>( name, width, height, texType, internalFormat ) |
---|
190 | 00237 { |
---|
191 | 00238 mPrivateTex = TextureManager::getSingleton().createManual |
---|
192 | 00239 (mName + <span class="stringliteral">"_PRIVATE##"</span>, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, |
---|
193 | 00240 texType, mWidth, mHeight, 0, internalFormat, <a class="code" href="namespaceOgre.html#a680a544">TU_RENDERTARGET</a> ); |
---|
194 | 00241 mPrivateTex->load(); |
---|
195 | 00242 } |
---|
196 | 00243 |
---|
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>() |
---|
198 | 00245 { |
---|
199 | 00246 mPrivateTex->unload(); |
---|
200 | 00247 TextureManager::getSingleton().remove(mPrivateTex->getName()); |
---|
201 | 00248 |
---|
202 | 00249 } |
---|
203 | 00250 |
---|
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>& name, <span class="keywordtype">void</span> *pData ) |
---|
205 | 00252 { |
---|
206 | 00253 <span class="keywordflow">if</span>( name == <span class="stringliteral">"DDBACKBUFFER"</span> ) |
---|
207 | 00254 { |
---|
208 | 00255 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData; |
---|
209 | 00256 <span class="keywordflow">if</span> (mPrivateTex->getTextureType() == <a class="code" href="namespaceOgre.html#a681a547">TEX_TYPE_2D</a>) |
---|
210 | 00257 mPrivateTex->getNormTexture()->GetSurfaceLevel( 0, &(*pSurf) ); |
---|
211 | 00258 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mPrivateTex->getTextureType() == <a class="code" href="namespaceOgre.html#a681a549">TEX_TYPE_CUBE_MAP</a>) |
---|
212 | 00259 mPrivateTex->getCubeTexture()->GetCubeMapSurface( (D3DCUBEMAP_FACES)0, 0, &(*pSurf) ); |
---|
213 | 00260 <span class="keywordflow">else</span> |
---|
214 | 00261 { |
---|
215 | 00262 <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>( Exception::UNIMPLEMENTED_FEATURE, |
---|
216 | 00263 <span class="stringliteral">"getCustomAttribute is implemented only for 2D and cube textures !!!"</span>, |
---|
217 | 00264 <span class="stringliteral">"D3D9RenderTexture::getCustomAttribute"</span> ); |
---|
218 | 00265 } |
---|
219 | 00266 <span class="comment">// decrement reference count</span> |
---|
220 | 00267 (*pSurf)->Release(); |
---|
221 | 00268 <span class="keywordflow">return</span>; |
---|
222 | 00269 } |
---|
223 | 00270 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"D3DZBUFFER"</span> ) |
---|
224 | 00271 { |
---|
225 | 00272 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData; |
---|
226 | 00273 *pSurf = mPrivateTex->getDepthStencil(); |
---|
227 | 00274 <span class="keywordflow">return</span>; |
---|
228 | 00275 } |
---|
229 | 00276 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"DDFRONTBUFFER"</span> ) |
---|
230 | 00277 { |
---|
231 | 00278 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData; |
---|
232 | 00279 <span class="keywordflow">if</span> (mPrivateTex->getTextureType() == <a class="code" href="namespaceOgre.html#a681a547">TEX_TYPE_2D</a>) |
---|
233 | 00280 mPrivateTex->getNormTexture()->GetSurfaceLevel( 0, &(*pSurf) ); |
---|
234 | 00281 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mPrivateTex->getTextureType() == <a class="code" href="namespaceOgre.html#a681a549">TEX_TYPE_CUBE_MAP</a>) |
---|
235 | 00282 mPrivateTex->getCubeTexture()->GetCubeMapSurface( (D3DCUBEMAP_FACES)0, 0, &(*pSurf) ); |
---|
236 | 00283 <span class="keywordflow">else</span> |
---|
237 | 00284 { |
---|
238 | 00285 <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>( Exception::UNIMPLEMENTED_FEATURE, |
---|
239 | 00286 <span class="stringliteral">"getCustomAttribute is implemented only for 2D and cube textures !!!"</span>, |
---|
240 | 00287 <span class="stringliteral">"D3D9RenderTexture::getCustomAttribute"</span> ); |
---|
241 | 00288 } |
---|
242 | 00289 (*pSurf)->Release(); |
---|
243 | 00290 <span class="keywordflow">return</span>; |
---|
244 | 00291 } |
---|
245 | 00292 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"HWND"</span> ) |
---|
246 | 00293 { |
---|
247 | 00294 HWND *pHwnd = (HWND*)pData; |
---|
248 | 00295 *pHwnd = NULL; |
---|
249 | 00296 <span class="keywordflow">return</span>; |
---|
250 | 00297 } |
---|
251 | 00298 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( name == <span class="stringliteral">"isTexture"</span> ) |
---|
252 | 00299 { |
---|
253 | 00300 <span class="keywordtype">bool</span> *b = reinterpret_cast< bool * >( pData ); |
---|
254 | 00301 *b = <span class="keyword">true</span>; |
---|
255 | 00302 <span class="keywordflow">return</span>; |
---|
256 | 00303 } |
---|
257 | 00304 } |
---|
258 | 00305 |
---|
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> & filename ) {} |
---|
261 | 00308 |
---|
262 | 00309 <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; |
---|
264 | 00312 |
---|
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>() |
---|
266 | 00314 { |
---|
267 | 00315 <span class="comment">// Copy the newly-rendered data to the public texture surface.</span> |
---|
268 | 00316 mPrivateTex->copyToTexture( mTexture ); |
---|
269 | 00317 } |
---|
270 | 00318 }; |
---|
271 | 00319 } |
---|
272 | 00320 |
---|
273 | 00321 <span class="preprocessor">#endif</span> |
---|
274 | </pre></div><hr> |
---|
275 | <p> |
---|
276 | Copyright © 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/> |
---|
278 | 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/> |
---|
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 | |
---|
286 | Last modified Sun Feb 12 12:59:44 2006 |
---|
287 | </p> |
---|
288 | </body> |
---|
289 | </html> |
---|