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> IDirect3DBaseTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">mpTex</a>; |
---|
60 | 00057 |
---|
61 | <a name="l00059"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">00059</a> <a class="code" href="namespaceOgre.html#a471">String</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">mCubeFaceNames</a>[6]; |
---|
62 | <a name="l00061"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep7">00061</a> D3DDEVICE_CREATION_PARAMETERS <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep7">mDevCreParams</a>; |
---|
63 | <a name="l00063"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep8">00063</a> D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep8">mBBPixelFormat</a>; |
---|
64 | <a name="l00065"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep9">00065</a> D3DPOOL mD3DPool; |
---|
65 | <a name="l00067"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep10">00067</a> D3DCAPS9 <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep10">mDevCaps</a>; |
---|
66 | 00068 <span class="comment">// Dynamic textures?</span> |
---|
67 | <a name="l00069"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep11">00069</a> <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep11">mDynamicTextures</a>; |
---|
68 | <a name="l00071"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturex0">00071</a> <span class="keyword">typedef</span> std::vector<HardwarePixelBufferSharedPtr> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturex0">SurfaceList</a>; |
---|
69 | <a name="l00072"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep12">00072</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturex0">SurfaceList</a> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep12">mSurfaceList</a>; |
---|
70 | 00073 |
---|
71 | 00075 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb0">_initDevice</a>(<span class="keywordtype">void</span>); |
---|
72 | 00077 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb1">_loadCubeTex</a>(); |
---|
73 | 00079 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb2">_loadNormTex</a>(); |
---|
74 | 00081 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb3">_loadVolumeTex</a>(); |
---|
75 | 00082 |
---|
76 | 00084 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb4">_createNormTex</a>(); |
---|
77 | 00086 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb5">_createCubeTex</a>(); |
---|
78 | 00088 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb6">_createVolumeTex</a>(); |
---|
79 | 00089 |
---|
80 | 00091 D3DFORMAT <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb7">_chooseD3DFormat</a>(); |
---|
81 | 00092 |
---|
82 | 00094 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb8">createInternalResourcesImpl</a>(<span class="keywordtype">void</span>); |
---|
83 | 00096 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb9">freeInternalResourcesImpl</a>(<span class="keywordtype">void</span>); |
---|
84 | 00098 <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); |
---|
85 | 00100 <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); |
---|
86 | 00102 D3DTEXTUREFILTERTYPE <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb12">_getBestFilterMethod</a>(); |
---|
87 | 00104 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb13">_canUseDynamicTextures</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat); |
---|
88 | 00106 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb14">_canAutoGenMipmaps</a>(DWORD srcUsage, D3DRESOURCETYPE srcType, D3DFORMAT srcFormat); |
---|
89 | 00107 |
---|
90 | <a name="l00109"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb15">00109</a> <a class="code" href="namespaceOgre.html#a471">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> |
---|
91 | 00110 <span class="keyword"> </span>{ assert(face < 6); <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep6">mCubeFaceNames</a>[face]; } |
---|
92 | 00111 |
---|
93 | 00114 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb16">_createSurfaceList</a>(<span class="keywordtype">void</span>); |
---|
94 | 00115 |
---|
95 | 00117 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Textureb17">loadImpl</a>(); |
---|
96 | 00118 <span class="keyword">public</span>: |
---|
97 | 00120 <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#a471">String</a>& name, <a class="code" href="namespaceOgre.html#a529">ResourceHandle</a> handle, |
---|
98 | 00121 <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& group, <span class="keywordtype">bool</span> isManual, <a class="code" href="classOgre_1_1ManualResourceLoader.html">ManualResourceLoader</a>* loader, |
---|
99 | 00122 IDirect3DDevice9 *pD3DDevice); |
---|
100 | 00124 <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea1">~D3D9Texture</a>(); |
---|
101 | 00125 |
---|
102 | 00127 <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 ); |
---|
103 | 00129 <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 ); |
---|
104 | 00130 |
---|
105 | 00131 |
---|
106 | 00133 <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); |
---|
107 | 00134 |
---|
108 | <a name="l00136"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea5">00136</a> IDirect3DBaseTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea5">getTexture</a>() |
---|
109 | 00137 { assert(<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">mpTex</a>); <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturep5">mpTex</a>; } |
---|
110 | <a name="l00139"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea6">00139</a> IDirect3DTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea6">getNormTexture</a>() |
---|
111 | 00140 { 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>; } |
---|
112 | <a name="l00142"></a><a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea7">00142</a> IDirect3DCubeTexture9 *<a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea7">getCubeTexture</a>() |
---|
113 | 00143 { 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>; } |
---|
114 | 00144 |
---|
115 | 00145 |
---|
116 | 00146 |
---|
117 | 00148 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea8">releaseIfDefaultPool</a>(<span class="keywordtype">void</span>); |
---|
118 | 00150 <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9Texture.html#Ogre_1_1D3D9Texturea9">recreateIfDefaultPool</a>(LPDIRECT3DDEVICE9 pDev); |
---|
119 | 00151 |
---|
120 | 00152 }; |
---|
121 | 00153 |
---|
122 | <a name="l00160"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html">00160</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> |
---|
123 | 00161 { |
---|
124 | 00162 <span class="keyword">public</span>: |
---|
125 | <a name="l00163"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra0">00163</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>>() {} |
---|
126 | <a name="l00164"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra1">00164</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) {} |
---|
127 | <a name="l00165"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra2">00165</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) {} |
---|
128 | <a name="l00166"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra3">00166</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>>() |
---|
129 | 00167 { |
---|
130 | 00168 <span class="comment">// lock & copy other mutex pointer</span> |
---|
131 | 00169 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
132 | 00170 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
133 | 00171 pRep = static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
134 | 00172 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
135 | 00173 <span class="keywordflow">if</span> (pUseCount) |
---|
136 | 00174 { |
---|
137 | 00175 ++(*pUseCount); |
---|
138 | 00176 } |
---|
139 | 00177 } |
---|
140 | 00178 |
---|
141 | <a name="l00180"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra4">00180</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) |
---|
142 | 00181 { |
---|
143 | 00182 <span class="keywordflow">if</span> (pRep == static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
144 | 00183 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
145 | 00184 <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>(); |
---|
146 | 00185 <span class="comment">// lock & copy other mutex pointer</span> |
---|
147 | 00186 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
148 | 00187 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
149 | 00188 pRep = static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
150 | 00189 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
151 | 00190 <span class="keywordflow">if</span> (pUseCount) |
---|
152 | 00191 { |
---|
153 | 00192 ++(*pUseCount); |
---|
154 | 00193 } |
---|
155 | 00194 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
156 | 00195 } |
---|
157 | <a name="l00197"></a><a class="code" href="classOgre_1_1D3D9TexturePtr.html#Ogre_1_1D3D9TexturePtra5">00197</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) |
---|
158 | 00198 { |
---|
159 | 00199 <span class="keywordflow">if</span> (pRep == static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>())) |
---|
160 | 00200 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
161 | 00201 <a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtrb0">release</a>(); |
---|
162 | 00202 <span class="comment">// lock & copy other mutex pointer</span> |
---|
163 | 00203 <a class="code" href="OgrePrerequisites_8h.html#a15">OGRE_LOCK_MUTEX</a>(*r.OGRE_AUTO_MUTEX_NAME) |
---|
164 | 00204 <a class="code" href="OgrePrerequisites_8h.html#a20">OGRE_COPY_AUTO_SHARED_MUTEX</a>(r.OGRE_AUTO_MUTEX_NAME) |
---|
165 | 00205 pRep = static_cast<D3D9Texture*>(r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra12">getPointer</a>()); |
---|
166 | 00206 pUseCount = r.<a class="code" href="classOgre_1_1SharedPtr.html#Ogre_1_1SharedPtra11">useCountPointer</a>(); |
---|
167 | 00207 <span class="keywordflow">if</span> (pUseCount) |
---|
168 | 00208 { |
---|
169 | 00209 ++(*pUseCount); |
---|
170 | 00210 } |
---|
171 | 00211 <span class="keywordflow">return</span> *<span class="keyword">this</span>; |
---|
172 | 00212 } |
---|
173 | 00213 }; |
---|
174 | 00214 |
---|
175 | <a name="l00216"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html">00216</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> |
---|
176 | 00217 { |
---|
177 | 00218 <span class="keyword">public</span>: |
---|
178 | <a name="l00219"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea0">00219</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#a471">String</a> &name, <a class="code" href="classOgre_1_1D3D9HardwarePixelBuffer.html">D3D9HardwarePixelBuffer</a> *buffer): |
---|
179 | 00220 <a class="code" href="classOgre_1_1RenderTexture.html">RenderTexture</a>(buffer, 0) |
---|
180 | 00221 { |
---|
181 | 00222 mName = name; |
---|
182 | 00223 } |
---|
183 | <a name="l00224"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea1">00224</a> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea1">~D3D9RenderTexture</a>() {} |
---|
184 | 00225 |
---|
185 | <a name="l00226"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea2">00226</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea2">rebind</a>(<a class="code" href="classOgre_1_1D3D9HardwarePixelBuffer.html">D3D9HardwarePixelBuffer</a> *buffer) |
---|
186 | 00227 { |
---|
187 | 00228 mBuffer = buffer; |
---|
188 | 00229 mWidth = mBuffer-><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera14">getWidth</a>(); |
---|
189 | 00230 mHeight = mBuffer-><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera15">getHeight</a>(); |
---|
190 | 00231 mColourDepth = <a class="code" href="classOgre_1_1PixelUtil.html#Ogre_1_1PixelUtile1">Ogre::PixelUtil::getNumElemBits</a>(mBuffer-><a class="code" href="classOgre_1_1HardwarePixelBuffer.html#Ogre_1_1HardwarePixelBuffera17">getFormat</a>()); |
---|
191 | 00232 } |
---|
192 | 00233 |
---|
193 | <a name="l00234"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea3">00234</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea3">getCustomAttribute</a>( <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a471">String</a>& name, <span class="keywordtype">void</span> *pData ) |
---|
194 | 00235 { |
---|
195 | 00236 <span class="keywordflow">if</span>(name == <span class="stringliteral">"DDBACKBUFFER"</span>) |
---|
196 | 00237 { |
---|
197 | 00238 IDirect3DSurface9 ** pSurf = (IDirect3DSurface9 **)pData; |
---|
198 | 00239 *pSurf = static_cast<D3D9HardwarePixelBuffer*>(mBuffer)->getSurface(); |
---|
199 | 00240 <span class="keywordflow">return</span>; |
---|
200 | 00241 } |
---|
201 | 00242 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(name == <span class="stringliteral">"HWND"</span>) |
---|
202 | 00243 { |
---|
203 | 00244 HWND *pHwnd = (HWND*)pData; |
---|
204 | 00245 *pHwnd = NULL; |
---|
205 | 00246 <span class="keywordflow">return</span>; |
---|
206 | 00247 } |
---|
207 | 00248 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(name == <span class="stringliteral">"BUFFER"</span>) |
---|
208 | 00249 { |
---|
209 | 00250 *static_cast<HardwarePixelBuffer**>(pData) = mBuffer; |
---|
210 | 00251 <span class="keywordflow">return</span>; |
---|
211 | 00252 } |
---|
212 | 00253 } |
---|
213 | 00254 |
---|
214 | <a name="l00255"></a><a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea4">00255</a> <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1D3D9RenderTexture.html#Ogre_1_1D3D9RenderTexturea4">requiresTextureFlipping</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } |
---|
215 | 00256 }; |
---|
216 | 00257 |
---|
217 | 00258 } |
---|
218 | 00259 |
---|
219 | 00260 <span class="preprocessor">#endif</span> |
---|
220 | </pre></div><hr> |
---|
221 | <p> |
---|
222 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
223 | <!--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/> |
---|
224 | 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/> |
---|
225 | <!--/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#"> |
---|
226 | <Work rdf:about=""> |
---|
227 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
228 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
229 | </Work> |
---|
230 | <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> --> |
---|
231 | |
---|
232 | Last modified Sun Mar 12 14:37:39 2006 |
---|
233 | </p> |
---|
234 | </body> |
---|
235 | </html> |
---|