1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreHardwareVertexBuffer.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>OgreHardwareVertexBuffer.h</h1><a href="OgreHardwareVertexBuffer_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 __HardwareVertexBuffer__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __HardwareVertexBuffer__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="comment">// Precompiler options</span> |
---|
38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreHardwareBuffer_8h.html">OgreHardwareBuffer.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreSharedPtr_8h.html">OgreSharedPtr.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreColourValue_8h.html">OgreColourValue.h</a>"</span> |
---|
42 | 00033 |
---|
43 | 00034 <span class="keyword">namespace </span>Ogre { |
---|
44 | <a name="l00036"></a><a class="code" href="classOgre_1_1HardwareVertexBuffer.html">00036</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> HardwareVertexBuffer : <span class="keyword">public</span> <a class="code" href="classOgre_1_1HardwareBuffer.html">HardwareBuffer</a> |
---|
45 | 00037 { |
---|
46 | 00038 <span class="keyword">protected</span>: |
---|
47 | 00039 |
---|
48 | <a name="l00040"></a><a class="code" href="classOgre_1_1HardwareVertexBuffer.html#Ogre_1_1HardwareVertexBufferp0">00040</a> size_t mNumVertices; |
---|
49 | <a name="l00041"></a><a class="code" href="classOgre_1_1HardwareVertexBuffer.html#Ogre_1_1HardwareVertexBufferp1">00041</a> size_t mVertexSize; |
---|
50 | 00042 |
---|
51 | 00043 <span class="keyword">public</span>: |
---|
52 | 00045 HardwareVertexBuffer(size_t vertexSize, size_t numVertices, |
---|
53 | 00046 HardwareBuffer::Usage usage, <span class="keywordtype">bool</span> useSystemMemory, <span class="keywordtype">bool</span> useShadowBuffer); |
---|
54 | 00047 ~HardwareVertexBuffer(); |
---|
55 | <a name="l00049"></a><a class="code" href="classOgre_1_1HardwareVertexBuffer.html#Ogre_1_1HardwareVertexBuffera2">00049</a> size_t getVertexSize(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mVertexSize; } |
---|
56 | <a name="l00051"></a><a class="code" href="classOgre_1_1HardwareVertexBuffer.html#Ogre_1_1HardwareVertexBuffera3">00051</a> size_t getNumVertices(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mNumVertices; } |
---|
57 | 00052 |
---|
58 | 00053 |
---|
59 | 00054 |
---|
60 | 00055 <span class="comment">// NB subclasses should override lock, unlock, readData, writeData</span> |
---|
61 | 00056 |
---|
62 | 00057 }; |
---|
63 | 00058 |
---|
64 | <a name="l00060"></a><a class="code" href="classOgre_1_1HardwareVertexBufferSharedPtr.html">00060</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> HardwareVertexBufferSharedPtr : <span class="keyword">public</span> <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><HardwareVertexBuffer> |
---|
65 | 00061 { |
---|
66 | 00062 <span class="keyword">public</span>: |
---|
67 | <a name="l00063"></a><a class="code" href="classOgre_1_1HardwareVertexBufferSharedPtr.html#Ogre_1_1HardwareVertexBufferSharedPtra0">00063</a> HardwareVertexBufferSharedPtr() : <a class="code" href="classOgre_1_1SharedPtr.html">SharedPtr</a><HardwareVertexBuffer>() {} |
---|
68 | 00064 <span class="keyword">explicit</span> HardwareVertexBufferSharedPtr(HardwareVertexBuffer* buf); |
---|
69 | 00065 |
---|
70 | 00066 |
---|
71 | 00067 }; |
---|
72 | 00068 |
---|
73 | <a name="l00070"></a><a class="code" href="namespaceOgre.html#a659">00070</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a659">VertexElementSemantic</a> { |
---|
74 | 00072 <a class="code" href="namespaceOgre.html#a659a167">VES_POSITION</a> = 1, |
---|
75 | 00074 <a class="code" href="namespaceOgre.html#a659a168">VES_BLEND_WEIGHTS</a> = 2, |
---|
76 | 00076 <a class="code" href="namespaceOgre.html#a659a169">VES_BLEND_INDICES</a> = 3, |
---|
77 | 00078 <a class="code" href="namespaceOgre.html#a659a170">VES_NORMAL</a> = 4, |
---|
78 | 00080 <a class="code" href="namespaceOgre.html#a659a171">VES_DIFFUSE</a> = 5, |
---|
79 | 00082 <a class="code" href="namespaceOgre.html#a659a172">VES_SPECULAR</a> = 6, |
---|
80 | 00084 <a class="code" href="namespaceOgre.html#a659a173">VES_TEXTURE_COORDINATES</a> = 7, |
---|
81 | 00086 <a class="code" href="namespaceOgre.html#a659a174">VES_BINORMAL</a> = 8, |
---|
82 | 00088 <a class="code" href="namespaceOgre.html#a659a175">VES_TANGENT</a> = 9 |
---|
83 | 00089 |
---|
84 | 00090 }; |
---|
85 | 00091 |
---|
86 | <a name="l00093"></a><a class="code" href="namespaceOgre.html#a660">00093</a> <span class="keyword">enum</span> <a class="code" href="namespaceOgre.html#a660">VertexElementType</a> |
---|
87 | 00094 { |
---|
88 | 00095 <a class="code" href="namespaceOgre.html#a660a176">VET_FLOAT1</a> = 0, |
---|
89 | 00096 <a class="code" href="namespaceOgre.html#a660a177">VET_FLOAT2</a> = 1, |
---|
90 | 00097 <a class="code" href="namespaceOgre.html#a660a178">VET_FLOAT3</a> = 2, |
---|
91 | 00098 <a class="code" href="namespaceOgre.html#a660a179">VET_FLOAT4</a> = 3, |
---|
92 | 00100 <a class="code" href="namespaceOgre.html#a660a180">VET_COLOUR</a> = 4, |
---|
93 | 00101 <a class="code" href="namespaceOgre.html#a660a181">VET_SHORT1</a> = 5, |
---|
94 | 00102 <a class="code" href="namespaceOgre.html#a660a182">VET_SHORT2</a> = 6, |
---|
95 | 00103 <a class="code" href="namespaceOgre.html#a660a183">VET_SHORT3</a> = 7, |
---|
96 | 00104 <a class="code" href="namespaceOgre.html#a660a184">VET_SHORT4</a> = 8, |
---|
97 | 00105 <a class="code" href="namespaceOgre.html#a660a185">VET_UBYTE4</a> = 9, |
---|
98 | 00107 <a class="code" href="namespaceOgre.html#a660a186">VET_COLOUR_ARGB</a> = 10, |
---|
99 | 00109 <a class="code" href="namespaceOgre.html#a660a187">VET_COLOUR_ABGR</a> = 11 |
---|
100 | 00110 }; |
---|
101 | 00111 |
---|
102 | <a name="l00121"></a><a class="code" href="classOgre_1_1VertexElement.html">00121</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> VertexElement |
---|
103 | 00122 { |
---|
104 | 00123 <span class="keyword">protected</span>: |
---|
105 | <a name="l00125"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp0">00125</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> mSource; |
---|
106 | <a name="l00127"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp1">00127</a> size_t mOffset; |
---|
107 | <a name="l00129"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp2">00129</a> <a class="code" href="namespaceOgre.html#a660">VertexElementType</a> mType; |
---|
108 | <a name="l00131"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp3">00131</a> <a class="code" href="namespaceOgre.html#a659">VertexElementSemantic</a> mSemantic; |
---|
109 | <a name="l00133"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp4">00133</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> mIndex; |
---|
110 | 00134 <span class="keyword">public</span>: |
---|
111 | 00136 VertexElement(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> source, size_t offset, VertexElementType theType, |
---|
112 | 00137 VertexElementSemantic semantic, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index = 0); |
---|
113 | <a name="l00139"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa1">00139</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getSource(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSource; } |
---|
114 | <a name="l00141"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa2">00141</a> size_t getOffset(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mOffset; } |
---|
115 | <a name="l00143"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa3">00143</a> <a class="code" href="namespaceOgre.html#a660">VertexElementType</a> getType(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mType; } |
---|
116 | <a name="l00145"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa4">00145</a> <a class="code" href="namespaceOgre.html#a659">VertexElementSemantic</a> getSemantic(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSemantic; } |
---|
117 | <a name="l00147"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa5">00147</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getIndex(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mIndex; } |
---|
118 | 00149 size_t getSize(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
119 | 00151 <span class="keyword">static</span> size_t getTypeSize(VertexElementType etype); |
---|
120 | 00153 <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getTypeCount(VertexElementType etype); |
---|
121 | 00157 <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a660">VertexElementType</a> multiplyTypeCount(VertexElementType baseType, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> count); |
---|
122 | 00161 <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a660">VertexElementType</a> getBaseType(VertexElementType multiType); |
---|
123 | 00162 |
---|
124 | 00169 <span class="keyword">static</span> <span class="keywordtype">void</span> convertColourValue(VertexElementType srcType, |
---|
125 | 00170 VertexElementType dstType, <a class="code" href="namespaceOgre.html#a455">uint32</a>* ptr); |
---|
126 | 00171 |
---|
127 | 00177 <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a455">uint32</a> convertColourValue(<span class="keyword">const</span> <a class="code" href="classOgre_1_1ColourValue.html">ColourValue</a>& src, |
---|
128 | 00178 VertexElementType dst); |
---|
129 | 00179 |
---|
130 | 00181 <span class="keyword">static</span> <a class="code" href="namespaceOgre.html#a660">VertexElementType</a> getBestColourVertexElementType(<span class="keywordtype">void</span>); |
---|
131 | 00182 |
---|
132 | <a name="l00183"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa7">00183</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceOgre.html#a623">operator== </a>(<span class="keyword">const</span> VertexElement& rhs)<span class="keyword"> const</span> |
---|
133 | 00184 <span class="keyword"> </span>{ |
---|
134 | 00185 <span class="keywordflow">if</span> (mType != rhs.<a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp2">mType</a> || |
---|
135 | 00186 mIndex != rhs.<a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp4">mIndex</a> || |
---|
136 | 00187 mOffset != rhs.<a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp1">mOffset</a> || |
---|
137 | 00188 mSemantic != rhs.<a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp3">mSemantic</a> || |
---|
138 | 00189 mSource != rhs.<a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementp0">mSource</a>) |
---|
139 | 00190 <span class="keywordflow">return</span> <span class="keyword">false</span>; |
---|
140 | 00191 <span class="keywordflow">else</span> |
---|
141 | 00192 <span class="keywordflow">return</span> <span class="keyword">true</span>; |
---|
142 | 00193 |
---|
143 | 00194 } |
---|
144 | <a name="l00202"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa8">00202</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> baseVertexPointerToElement(<span class="keywordtype">void</span>* pBase, <span class="keywordtype">void</span>** pElem)<span class="keyword"> const</span> |
---|
145 | 00203 <span class="keyword"> </span>{ |
---|
146 | 00204 <span class="comment">// The only way we can do this is to cast to char* in order to use byte offset</span> |
---|
147 | 00205 <span class="comment">// then cast back to void*.</span> |
---|
148 | 00206 *pElem = static_cast<void*>( |
---|
149 | 00207 static_cast<unsigned char*>(pBase) + mOffset); |
---|
150 | 00208 } |
---|
151 | <a name="l00216"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa9">00216</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> baseVertexPointerToElement(<span class="keywordtype">void</span>* pBase, <span class="keywordtype">float</span>** pElem)<span class="keyword"> const</span> |
---|
152 | 00217 <span class="keyword"> </span>{ |
---|
153 | 00218 <span class="comment">// The only way we can do this is to cast to char* in order to use byte offset</span> |
---|
154 | 00219 <span class="comment">// then cast back to float*. However we have to go via void* because casting</span> |
---|
155 | 00220 <span class="comment">// directly is not allowed</span> |
---|
156 | 00221 *pElem = static_cast<float*>( |
---|
157 | 00222 static_cast<void*>( |
---|
158 | 00223 static_cast<unsigned char*>(pBase) + mOffset)); |
---|
159 | 00224 } |
---|
160 | 00225 |
---|
161 | <a name="l00233"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa10">00233</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> baseVertexPointerToElement(<span class="keywordtype">void</span>* pBase, <a class="code" href="namespaceOgre.html#a68">RGBA</a>** pElem)<span class="keyword"> const</span> |
---|
162 | 00234 <span class="keyword"> </span>{ |
---|
163 | 00235 *pElem = static_cast<RGBA*>( |
---|
164 | 00236 static_cast<void*>( |
---|
165 | 00237 static_cast<unsigned char*>(pBase) + mOffset)); |
---|
166 | 00238 } |
---|
167 | <a name="l00246"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa11">00246</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> baseVertexPointerToElement(<span class="keywordtype">void</span>* pBase, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>** pElem)<span class="keyword"> const</span> |
---|
168 | 00247 <span class="keyword"> </span>{ |
---|
169 | 00248 *pElem = static_cast<unsigned char*>(pBase) + mOffset; |
---|
170 | 00249 } |
---|
171 | 00250 |
---|
172 | <a name="l00258"></a><a class="code" href="classOgre_1_1VertexElement.html#Ogre_1_1VertexElementa12">00258</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> baseVertexPointerToElement(<span class="keywordtype">void</span>* pBase, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span>** pElem)<span class="keyword"> const</span> |
---|
173 | 00259 <span class="keyword"> </span>{ |
---|
174 | 00260 *pElem = static_cast<unsigned short*>(pBase) + mOffset; |
---|
175 | 00261 } |
---|
176 | 00262 |
---|
177 | 00263 |
---|
178 | 00264 }; |
---|
179 | <a name="l00287"></a><a class="code" href="classOgre_1_1VertexDeclaration.html">00287</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> VertexDeclaration |
---|
180 | 00288 { |
---|
181 | 00289 <span class="keyword">public</span>: |
---|
182 | <a name="l00291"></a><a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationw0">00291</a> <span class="keyword">typedef</span> std::list<VertexElement> <a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationw0">VertexElementList</a>; |
---|
183 | 00293 <span class="keyword">static</span> <span class="keywordtype">bool</span> vertexElementLess(<span class="keyword">const</span> VertexElement& e1, <span class="keyword">const</span> VertexElement& e2); |
---|
184 | 00294 <span class="keyword">protected</span>: |
---|
185 | <a name="l00295"></a><a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationp0">00295</a> <a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationw0">VertexElementList</a> mElementList; |
---|
186 | 00296 <span class="keyword">public</span>: |
---|
187 | 00298 VertexDeclaration(); |
---|
188 | 00299 <span class="keyword">virtual</span> ~VertexDeclaration(); |
---|
189 | 00300 |
---|
190 | <a name="l00302"></a><a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationa2">00302</a> size_t getElementCount(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> mElementList.size(); } |
---|
191 | 00304 <span class="keyword">const</span> VertexElementList& getElements(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
192 | 00306 <span class="keyword">const</span> VertexElement* getElement(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
193 | 00307 |
---|
194 | 00316 <span class="keywordtype">void</span> sort(<span class="keywordtype">void</span>); |
---|
195 | 00317 |
---|
196 | 00328 <span class="keywordtype">void</span> closeGapsInSource(<span class="keywordtype">void</span>); |
---|
197 | 00329 |
---|
198 | 00340 VertexDeclaration* getAutoOrganisedDeclaration(<span class="keywordtype">bool</span> skeletalAnimation, |
---|
199 | 00341 <span class="keywordtype">bool</span> vertexAnimation); |
---|
200 | 00342 |
---|
201 | 00344 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getMaxSource(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
202 | 00345 |
---|
203 | 00346 |
---|
204 | 00347 |
---|
205 | 00361 <span class="keyword">virtual</span> <span class="keyword">const</span> VertexElement& addElement(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> source, size_t offset, VertexElementType theType, |
---|
206 | 00362 VertexElementSemantic semantic, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index = 0); |
---|
207 | 00376 <span class="keyword">virtual</span> <span class="keyword">const</span> VertexElement& insertElement(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> atPosition, |
---|
208 | 00377 <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> source, size_t offset, VertexElementType theType, |
---|
209 | 00378 VertexElementSemantic semantic, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index = 0); |
---|
210 | 00379 |
---|
211 | 00381 <span class="keyword">virtual</span> <span class="keywordtype">void</span> removeElement(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> elem_index); |
---|
212 | 00382 |
---|
213 | 00389 <span class="keyword">virtual</span> <span class="keywordtype">void</span> removeElement(VertexElementSemantic semantic, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index = 0); |
---|
214 | 00390 |
---|
215 | 00392 <span class="keyword">virtual</span> <span class="keywordtype">void</span> removeAllElements(<span class="keywordtype">void</span>); |
---|
216 | 00393 |
---|
217 | 00399 <span class="keyword">virtual</span> <span class="keywordtype">void</span> modifyElement(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> elem_index, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> source, size_t offset, VertexElementType theType, |
---|
218 | 00400 VertexElementSemantic semantic, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index = 0); |
---|
219 | 00401 |
---|
220 | 00407 <span class="keyword">virtual</span> <span class="keyword">const</span> VertexElement* findElementBySemantic(VertexElementSemantic sem, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index = 0); |
---|
221 | 00417 <span class="keyword">virtual</span> VertexElementList findElementsBySource(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> source); |
---|
222 | 00418 |
---|
223 | 00420 <span class="keyword">virtual</span> size_t getVertexSize(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> source); |
---|
224 | 00421 |
---|
225 | 00423 <span class="keyword">virtual</span> VertexDeclaration* clone(<span class="keywordtype">void</span>); |
---|
226 | 00424 |
---|
227 | <a name="l00425"></a><a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationa19">00425</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceOgre.html#a623">operator== </a>(<span class="keyword">const</span> VertexDeclaration& rhs)<span class="keyword"> const</span> |
---|
228 | 00426 <span class="keyword"> </span>{ |
---|
229 | 00427 <span class="keywordflow">if</span> (mElementList.size() != rhs.<a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationp0">mElementList</a>.size()) |
---|
230 | 00428 <span class="keywordflow">return</span> <span class="keyword">false</span>; |
---|
231 | 00429 |
---|
232 | 00430 VertexElementList::const_iterator i, iend, rhsi, rhsiend; |
---|
233 | 00431 iend = mElementList.end(); |
---|
234 | 00432 rhsiend = rhs.<a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationp0">mElementList</a>.end(); |
---|
235 | 00433 rhsi = rhs.<a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationp0">mElementList</a>.begin(); |
---|
236 | 00434 <span class="keywordflow">for</span> (i = mElementList.begin(); i != iend && rhsi != rhsiend; ++i, ++rhsi) |
---|
237 | 00435 { |
---|
238 | 00436 <span class="keywordflow">if</span> ( !(*i == *rhsi) ) |
---|
239 | 00437 <span class="keywordflow">return</span> <span class="keyword">false</span>; |
---|
240 | 00438 } |
---|
241 | 00439 |
---|
242 | 00440 <span class="keywordflow">return</span> <span class="keyword">true</span>; |
---|
243 | 00441 } |
---|
244 | <a name="l00442"></a><a class="code" href="classOgre_1_1VertexDeclaration.html#Ogre_1_1VertexDeclarationa20">00442</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceOgre.html#a624">operator!= </a>(<span class="keyword">const</span> VertexDeclaration& rhs)<span class="keyword"> const</span> |
---|
245 | 00443 <span class="keyword"> </span>{ |
---|
246 | 00444 <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == rhs); |
---|
247 | 00445 } |
---|
248 | 00446 |
---|
249 | 00447 }; |
---|
250 | 00448 |
---|
251 | <a name="l00462"></a><a class="code" href="classOgre_1_1VertexBufferBinding.html">00462</a> <span class="keyword">class </span><a class="code" href="class__OgreExport.html">_OgreExport</a> VertexBufferBinding |
---|
252 | 00463 { |
---|
253 | 00464 <span class="keyword">public</span>: |
---|
254 | <a name="l00466"></a><a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindingw0">00466</a> <span class="keyword">typedef</span> std::map<unsigned short, HardwareVertexBufferSharedPtr> <a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindingw0">VertexBufferBindingMap</a>; |
---|
255 | 00467 <span class="keyword">protected</span>: |
---|
256 | <a name="l00468"></a><a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindingp0">00468</a> <a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindingw0">VertexBufferBindingMap</a> mBindingMap; |
---|
257 | <a name="l00469"></a><a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindingp1">00469</a> <span class="keyword">mutable</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> mHighIndex; |
---|
258 | 00470 <span class="keyword">public</span>: |
---|
259 | 00472 VertexBufferBinding(); |
---|
260 | 00473 <span class="keyword">virtual</span> ~VertexBufferBinding(); |
---|
261 | 00482 <span class="keyword">virtual</span> <span class="keywordtype">void</span> setBinding(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index, HardwareVertexBufferSharedPtr buffer); |
---|
262 | 00484 <span class="keyword">virtual</span> <span class="keywordtype">void</span> unsetBinding(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
263 | 00485 |
---|
264 | 00487 <span class="keyword">virtual</span> <span class="keywordtype">void</span> unsetAllBindings(<span class="keywordtype">void</span>); |
---|
265 | 00488 |
---|
266 | 00490 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindingw0">VertexBufferBindingMap</a>& getBindings(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
267 | 00491 |
---|
268 | 00493 <span class="keyword">virtual</span> HardwareVertexBufferSharedPtr getBuffer(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
269 | 00495 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> isBufferBound(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> index); |
---|
270 | 00496 |
---|
271 | <a name="l00497"></a><a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindinga8">00497</a> <span class="keyword">virtual</span> size_t getBufferCount(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mBindingMap.size(); } |
---|
272 | 00498 |
---|
273 | <a name="l00504"></a><a class="code" href="classOgre_1_1VertexBufferBinding.html#Ogre_1_1VertexBufferBindinga9">00504</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getNextIndex(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mHighIndex++; } |
---|
274 | 00505 |
---|
275 | 00506 |
---|
276 | 00507 |
---|
277 | 00508 |
---|
278 | 00509 }; |
---|
279 | 00510 |
---|
280 | 00511 |
---|
281 | 00512 |
---|
282 | 00513 } |
---|
283 | 00514 <span class="preprocessor">#endif</span> |
---|
284 | 00515 <span class="preprocessor"></span> |
---|
285 | </pre></div><hr> |
---|
286 | <p> |
---|
287 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
288 | <!--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/> |
---|
289 | 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/> |
---|
290 | <!--/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#"> |
---|
291 | <Work rdf:about=""> |
---|
292 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
293 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
294 | </Work> |
---|
295 | <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> --> |
---|
296 | |
---|
297 | Last modified Sun Mar 12 14:37:42 2006 |
---|
298 | </p> |
---|
299 | </body> |
---|
300 | </html> |
---|