\hypertarget{class_ogre_1_1_vertex_declaration}{}\doxysection{Ogre\+::Vertex\+Declaration Class Reference}
\label{class_ogre_1_1_vertex_declaration}\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}


This class declares the format of a set of vertex inputs, which can be issued to the rendering A\+PI through a \mbox{\hyperlink{class_ogre_1_1_render_operation}{Render\+Operation}}.  




{\ttfamily \#include $<$Ogre\+Hardware\+Vertex\+Buffer.\+h$>$}



Inheritance diagram for Ogre\+::Vertex\+Declaration\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_ogre_1_1_vertex_declaration__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef std\+::list$<$ \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} $>$ \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}{Vertex\+Element\+List}}
\begin{DoxyCompactList}\small\item\em Defines the list of vertex elements that makes up this declaration. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a564fde701486b259f4f995a799adb433}{Vertex\+Declaration}} ()
\begin{DoxyCompactList}\small\item\em Standard constructor, not you should use \mbox{\hyperlink{class_ogre_1_1_hardware_buffer_manager_base_abe3ea209174c3a40286dde425addb814}{Hardware\+Buffer\+Manager\+::create\+Vertex\+Declaration}}. \end{DoxyCompactList}\item 
virtual \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a27c14f93e37659aa583f572ba250b155}{$\sim$\+Vertex\+Declaration}} ()
\item 
const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} \& \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a8b1a5f5fe0b7306da4c8b17357d45fac}{add\+Element}} (unsigned short source, size\+\_\+t offset, \mbox{\hyperlink{group___render_system_ga027109503a988ba85f4c63b55082907f}{Vertex\+Element\+Type}} the\+Type, \mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}} semantic, unsigned short index=0)
\begin{DoxyCompactList}\small\item\em Adds a new \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} to this declaration. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a3c1091f7ece9bbc4e4f847484fd75a37}{clone}} (\mbox{\hyperlink{class_ogre_1_1_hardware_buffer_manager_base}{Hardware\+Buffer\+Manager\+Base}} $\ast$mgr=0) const \mbox{\hyperlink{_ogre_platform_8h_a11162eebee0099930c48076229cc6f04}{O\+G\+R\+E\+\_\+\+N\+O\+D\+I\+S\+C\+A\+RD}}
\begin{DoxyCompactList}\small\item\em Clones this declaration. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a260ecb704cfc32b82f248e382a53be47}{close\+Gaps\+In\+Source}} (void)
\begin{DoxyCompactList}\small\item\em Remove any gaps in the source buffer list used by this declaration. \end{DoxyCompactList}\item 
const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a469bd849411d3f152d700772fab64501}{find\+Element\+By\+Semantic}} (\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}} sem, unsigned short index=0) const
\begin{DoxyCompactList}\small\item\em Finds a \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} with the given semantic, and index if there is more than one element with the same semantic. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}{Vertex\+Element\+List}} \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_ada92fbc9ee87b04f8a3c389c71904ce6}{find\+Elements\+By\+Source}} (unsigned short source) const
\begin{DoxyCompactList}\small\item\em Based on the current elements, gets the size of the vertex for a given buffer source. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a130fa715330d23d0e9d2feef630b460c}{get\+Auto\+Organised\+Declaration}} (bool skeletal\+Animation, bool vertex\+Animation, bool vertex\+Animation\+Normals) const
\begin{DoxyCompactList}\small\item\em Generates a new \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} for optimal usage based on the current vertex declaration, which can be used with \mbox{\hyperlink{class_ogre_1_1_vertex_data_a106603d9d4d6c2f6e0d5eb6c25eb7c32}{Vertex\+Data\+::reorganise\+Buffers}} later if you wish, or simply used as a template. \end{DoxyCompactList}\item 
const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_aed9f1ba13a68148ce730fafdb4834ba5}{get\+Element}} (unsigned short index) const
\begin{DoxyCompactList}\small\item\em Get a single element. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a1bc75972c04228ebf539e242d57b7203}{get\+Element\+Count}} (void) const
\begin{DoxyCompactList}\small\item\em Get the number of elements in the declaration. \end{DoxyCompactList}\item 
const \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}{Vertex\+Element\+List}} \& \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a9673b478f78c55754cf410b223c5a06a}{get\+Elements}} (void) const
\begin{DoxyCompactList}\small\item\em Gets read-\/only access to the list of vertex elements. \end{DoxyCompactList}\item 
unsigned short \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_ae8e81e6e6209774c203a0edf44032e65}{get\+Max\+Source}} (void) const
\begin{DoxyCompactList}\small\item\em Gets the index of the highest source value referenced by this declaration. \end{DoxyCompactList}\item 
unsigned short \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a4f99e40285b5c122843b681477983ab1}{get\+Next\+Free\+Texture\+Coordinate}} () const
\begin{DoxyCompactList}\small\item\em Return the index of the next free texture coordinate set which may be added to this declaration. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_ad34cfa2c7ebdadfb5101ce751e6ab039}{get\+Vertex\+Size}} (unsigned short source) const
\begin{DoxyCompactList}\small\item\em Gets the vertex size defined by this declaration for a given source. \end{DoxyCompactList}\item 
const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} \& \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_adb0dd4e0b21379635c0c54f37ef90e1d}{insert\+Element}} (unsigned short at\+Position, unsigned short source, size\+\_\+t offset, \mbox{\hyperlink{group___render_system_ga027109503a988ba85f4c63b55082907f}{Vertex\+Element\+Type}} the\+Type, \mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}} semantic, unsigned short index=0)
\begin{DoxyCompactList}\small\item\em Inserts a new \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} at a given position in this declaration. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a3c71e39ce3fe6007e797744c8ef2f339}{modify\+Element}} (unsigned short elem\+\_\+index, unsigned short source, size\+\_\+t offset, \mbox{\hyperlink{group___render_system_ga027109503a988ba85f4c63b55082907f}{Vertex\+Element\+Type}} the\+Type, \mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}} semantic, unsigned short index=0)
\begin{DoxyCompactList}\small\item\em Modify an element in-\/place, params as add\+Element. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a1049733c9da2b8a49590b1f942c1b4ae}{operator!=}} (const \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} \&rhs) const
\item 
bool \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_aa8323ecd73a854f8c72fd6ac2618e3ee}{operator==}} (const \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} \&rhs) const
\item 
void \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a69505e015a422c94a15831fdfbf87770}{remove\+All\+Elements}} (void)
\begin{DoxyCompactList}\small\item\em Remove all elements. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a43113eabfb0d8a80a79a8c7413ad139c}{remove\+Element}} (unsigned short elem\+\_\+index)
\begin{DoxyCompactList}\small\item\em Remove the element at the given index from this declaration. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a12fad67983499876ffe66bc087cd7d0b}{remove\+Element}} (\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}} semantic, unsigned short index=0)
\begin{DoxyCompactList}\small\item\em Remove the element with the given semantic and usage index. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a98cce285a45ba6f4cf817dcf46bfb588}{sort}} (void)
\begin{DoxyCompactList}\small\item\em Sorts the elements in this list to be compatible with D3\+D7 graphics cards. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static bool \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a670466fe9bcfc426ccefb5395a3a82ef}{vertex\+Element\+Less}} (const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} \&e1, const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} \&e2)
\begin{DoxyCompactList}\small\item\em Sort routine for vertex elements. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This class declares the format of a set of vertex inputs, which can be issued to the rendering A\+PI through a \mbox{\hyperlink{class_ogre_1_1_render_operation}{Render\+Operation}}. 

The ordering is important on Direct3\+D9 with Direct3D 7 grade cards. Calling \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a260ecb704cfc32b82f248e382a53be47}{close\+Gaps\+In\+Source()}} will format this \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} accordingly.

Whilst GL and more modern graphics cards in D3D will allow you to defy these rules, sticking to them will reduce state changes and improve performance on modern A\+P\+Is as well.

Like the other classes in this functional area, these declarations should be created and destroyed using the \mbox{\hyperlink{class_ogre_1_1_hardware_buffer_manager}{Hardware\+Buffer\+Manager}}. 

\doxysubsection{Member Typedef Documentation}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}\label{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!VertexElementList@{VertexElementList}}
\index{VertexElementList@{VertexElementList}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{VertexElementList}{VertexElementList}}
{\footnotesize\ttfamily typedef std\+::list$<$\mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}}$>$ \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}{Ogre\+::\+Vertex\+Declaration\+::\+Vertex\+Element\+List}}}



Defines the list of vertex elements that makes up this declaration. 



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a564fde701486b259f4f995a799adb433}\label{class_ogre_1_1_vertex_declaration_a564fde701486b259f4f995a799adb433}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!VertexDeclaration@{VertexDeclaration}}
\index{VertexDeclaration@{VertexDeclaration}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{VertexDeclaration()}{VertexDeclaration()}}
{\footnotesize\ttfamily Ogre\+::\+Vertex\+Declaration\+::\+Vertex\+Declaration (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Standard constructor, not you should use \mbox{\hyperlink{class_ogre_1_1_hardware_buffer_manager_base_abe3ea209174c3a40286dde425addb814}{Hardware\+Buffer\+Manager\+::create\+Vertex\+Declaration}}. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a27c14f93e37659aa583f572ba250b155}\label{class_ogre_1_1_vertex_declaration_a27c14f93e37659aa583f572ba250b155}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!````~VertexDeclaration@{$\sim$VertexDeclaration}}
\index{````~VertexDeclaration@{$\sim$VertexDeclaration}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{$\sim$VertexDeclaration()}{~VertexDeclaration()}}
{\footnotesize\ttfamily virtual Ogre\+::\+Vertex\+Declaration\+::$\sim$\+Vertex\+Declaration (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}}



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a670466fe9bcfc426ccefb5395a3a82ef}\label{class_ogre_1_1_vertex_declaration_a670466fe9bcfc426ccefb5395a3a82ef}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!vertexElementLess@{vertexElementLess}}
\index{vertexElementLess@{vertexElementLess}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{vertexElementLess()}{vertexElementLess()}}
{\footnotesize\ttfamily static bool Ogre\+::\+Vertex\+Declaration\+::vertex\+Element\+Less (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} \&}]{e1,  }\item[{const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} \&}]{e2 }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Sort routine for vertex elements. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a1bc75972c04228ebf539e242d57b7203}\label{class_ogre_1_1_vertex_declaration_a1bc75972c04228ebf539e242d57b7203}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getElementCount@{getElementCount}}
\index{getElementCount@{getElementCount}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getElementCount()}{getElementCount()}}
{\footnotesize\ttfamily size\+\_\+t Ogre\+::\+Vertex\+Declaration\+::get\+Element\+Count (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of elements in the declaration. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a9673b478f78c55754cf410b223c5a06a}\label{class_ogre_1_1_vertex_declaration_a9673b478f78c55754cf410b223c5a06a}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getElements@{getElements}}
\index{getElements@{getElements}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getElements()}{getElements()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}{Vertex\+Element\+List}}\& Ogre\+::\+Vertex\+Declaration\+::get\+Elements (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const}



Gets read-\/only access to the list of vertex elements. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_aed9f1ba13a68148ce730fafdb4834ba5}\label{class_ogre_1_1_vertex_declaration_aed9f1ba13a68148ce730fafdb4834ba5}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getElement@{getElement}}
\index{getElement@{getElement}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getElement()}{getElement()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}}$\ast$ Ogre\+::\+Vertex\+Declaration\+::get\+Element (\begin{DoxyParamCaption}\item[{unsigned short}]{index }\end{DoxyParamCaption}) const}



Get a single element. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a98cce285a45ba6f4cf817dcf46bfb588}\label{class_ogre_1_1_vertex_declaration_a98cce285a45ba6f4cf817dcf46bfb588}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!sort@{sort}}
\index{sort@{sort}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{sort()}{sort()}}
{\footnotesize\ttfamily void Ogre\+::\+Vertex\+Declaration\+::sort (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Sorts the elements in this list to be compatible with D3\+D7 graphics cards. 

the order is as follows\+: position, blending weights, normals, diffuse colours, specular colours, texture coordinates \mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a260ecb704cfc32b82f248e382a53be47}\label{class_ogre_1_1_vertex_declaration_a260ecb704cfc32b82f248e382a53be47}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!closeGapsInSource@{closeGapsInSource}}
\index{closeGapsInSource@{closeGapsInSource}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{closeGapsInSource()}{closeGapsInSource()}}
{\footnotesize\ttfamily void Ogre\+::\+Vertex\+Declaration\+::close\+Gaps\+In\+Source (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Remove any gaps in the source buffer list used by this declaration. 

\begin{DoxyRemark}{Remarks}
This is useful if you\textquotesingle{}ve modified a declaration and want to remove any gaps in the list of buffers being used. Note, however, that if this declaration is already being used with a \mbox{\hyperlink{class_ogre_1_1_vertex_buffer_binding}{Vertex\+Buffer\+Binding}}, you will need to alter that too. This method is mainly useful when reorganising buffers based on an altered declaration. 
\end{DoxyRemark}
\begin{DoxyNote}{Note}
This will also call \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a98cce285a45ba6f4cf817dcf46bfb588}{sort()}} 
\end{DoxyNote}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a130fa715330d23d0e9d2feef630b460c}\label{class_ogre_1_1_vertex_declaration_a130fa715330d23d0e9d2feef630b460c}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getAutoOrganisedDeclaration@{getAutoOrganisedDeclaration}}
\index{getAutoOrganisedDeclaration@{getAutoOrganisedDeclaration}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getAutoOrganisedDeclaration()}{getAutoOrganisedDeclaration()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}}$\ast$ Ogre\+::\+Vertex\+Declaration\+::get\+Auto\+Organised\+Declaration (\begin{DoxyParamCaption}\item[{bool}]{skeletal\+Animation,  }\item[{bool}]{vertex\+Animation,  }\item[{bool}]{vertex\+Animation\+Normals }\end{DoxyParamCaption}) const}



Generates a new \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} for optimal usage based on the current vertex declaration, which can be used with \mbox{\hyperlink{class_ogre_1_1_vertex_data_a106603d9d4d6c2f6e0d5eb6c25eb7c32}{Vertex\+Data\+::reorganise\+Buffers}} later if you wish, or simply used as a template. 

\begin{DoxyRemark}{Remarks}
Different buffer organisations and buffer usages will be returned depending on the parameters passed to this method. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em skeletal\+Animation} & Whether this vertex data is going to be skeletally animated \\
\hline
{\em vertex\+Animation} & Whether this vertex data is going to be vertex animated \\
\hline
{\em vertex\+Animation\+Normals} & Whether vertex data animation is going to include normals animation \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_ae8e81e6e6209774c203a0edf44032e65}\label{class_ogre_1_1_vertex_declaration_ae8e81e6e6209774c203a0edf44032e65}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getMaxSource@{getMaxSource}}
\index{getMaxSource@{getMaxSource}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getMaxSource()}{getMaxSource()}}
{\footnotesize\ttfamily unsigned short Ogre\+::\+Vertex\+Declaration\+::get\+Max\+Source (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const}



Gets the index of the highest source value referenced by this declaration. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a8b1a5f5fe0b7306da4c8b17357d45fac}\label{class_ogre_1_1_vertex_declaration_a8b1a5f5fe0b7306da4c8b17357d45fac}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!addElement@{addElement}}
\index{addElement@{addElement}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{addElement()}{addElement()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}}\& Ogre\+::\+Vertex\+Declaration\+::add\+Element (\begin{DoxyParamCaption}\item[{unsigned short}]{source,  }\item[{size\+\_\+t}]{offset,  }\item[{\mbox{\hyperlink{group___render_system_ga027109503a988ba85f4c63b55082907f}{Vertex\+Element\+Type}}}]{the\+Type,  }\item[{\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}}}]{semantic,  }\item[{unsigned short}]{index = {\ttfamily 0} }\end{DoxyParamCaption})}



Adds a new \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} to this declaration. 

\begin{DoxyRemark}{Remarks}
This method adds a single element (positions, normals etc) to the end of the vertex declaration. {\bfseries{Please read the information in \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} about the importance of ordering and structure for compatibility with older D3D drivers}}. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em source} & The binding index of \mbox{\hyperlink{class_ogre_1_1_hardware_vertex_buffer}{Hardware\+Vertex\+Buffer}} which will provide the source for this element. See \mbox{\hyperlink{class_ogre_1_1_vertex_buffer_binding}{Vertex\+Buffer\+Binding}} for full information. \\
\hline
{\em offset} & The offset in bytes where this element is located in the buffer \\
\hline
{\em the\+Type} & The data format of the element (3 floats, a colour etc) \\
\hline
{\em semantic} & The meaning of the data (position, normal, diffuse colour etc) \\
\hline
{\em index} & Optional index for multi-\/input elements like texture coordinates \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} added. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_adb0dd4e0b21379635c0c54f37ef90e1d}\label{class_ogre_1_1_vertex_declaration_adb0dd4e0b21379635c0c54f37ef90e1d}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!insertElement@{insertElement}}
\index{insertElement@{insertElement}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{insertElement()}{insertElement()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}}\& Ogre\+::\+Vertex\+Declaration\+::insert\+Element (\begin{DoxyParamCaption}\item[{unsigned short}]{at\+Position,  }\item[{unsigned short}]{source,  }\item[{size\+\_\+t}]{offset,  }\item[{\mbox{\hyperlink{group___render_system_ga027109503a988ba85f4c63b55082907f}{Vertex\+Element\+Type}}}]{the\+Type,  }\item[{\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}}}]{semantic,  }\item[{unsigned short}]{index = {\ttfamily 0} }\end{DoxyParamCaption})}



Inserts a new \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} at a given position in this declaration. 

\begin{DoxyRemark}{Remarks}
This method adds a single element (positions, normals etc) at a given position in this vertex declaration. {\bfseries{Please read the information in \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} about the importance of ordering and structure for compatibility with older D3D drivers}}. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em source} & The binding index of \mbox{\hyperlink{class_ogre_1_1_hardware_vertex_buffer}{Hardware\+Vertex\+Buffer}} which will provide the source for this element. See \mbox{\hyperlink{class_ogre_1_1_vertex_buffer_binding}{Vertex\+Buffer\+Binding}} for full information. \\
\hline
{\em offset} & The offset in bytes where this element is located in the buffer \\
\hline
{\em the\+Type} & The data format of the element (3 floats, a colour etc) \\
\hline
{\em semantic} & The meaning of the data (position, normal, diffuse colour etc) \\
\hline
{\em index} & Optional index for multi-\/input elements like texture coordinates \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to the \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} added. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a43113eabfb0d8a80a79a8c7413ad139c}\label{class_ogre_1_1_vertex_declaration_a43113eabfb0d8a80a79a8c7413ad139c}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!removeElement@{removeElement}}
\index{removeElement@{removeElement}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{removeElement()}{removeElement()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Vertex\+Declaration\+::remove\+Element (\begin{DoxyParamCaption}\item[{unsigned short}]{elem\+\_\+index }\end{DoxyParamCaption})}



Remove the element at the given index from this declaration. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a12fad67983499876ffe66bc087cd7d0b}\label{class_ogre_1_1_vertex_declaration_a12fad67983499876ffe66bc087cd7d0b}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!removeElement@{removeElement}}
\index{removeElement@{removeElement}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{removeElement()}{removeElement()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily void Ogre\+::\+Vertex\+Declaration\+::remove\+Element (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}}}]{semantic,  }\item[{unsigned short}]{index = {\ttfamily 0} }\end{DoxyParamCaption})}



Remove the element with the given semantic and usage index. 

\begin{DoxyRemark}{Remarks}
In this case \textquotesingle{}index\textquotesingle{} means the usage index for repeating elements such as texture coordinates. For other elements this will always be 0 and does not refer to the index in the vector. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a69505e015a422c94a15831fdfbf87770}\label{class_ogre_1_1_vertex_declaration_a69505e015a422c94a15831fdfbf87770}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!removeAllElements@{removeAllElements}}
\index{removeAllElements@{removeAllElements}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{removeAllElements()}{removeAllElements()}}
{\footnotesize\ttfamily void Ogre\+::\+Vertex\+Declaration\+::remove\+All\+Elements (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Remove all elements. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a3c71e39ce3fe6007e797744c8ef2f339}\label{class_ogre_1_1_vertex_declaration_a3c71e39ce3fe6007e797744c8ef2f339}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!modifyElement@{modifyElement}}
\index{modifyElement@{modifyElement}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{modifyElement()}{modifyElement()}}
{\footnotesize\ttfamily void Ogre\+::\+Vertex\+Declaration\+::modify\+Element (\begin{DoxyParamCaption}\item[{unsigned short}]{elem\+\_\+index,  }\item[{unsigned short}]{source,  }\item[{size\+\_\+t}]{offset,  }\item[{\mbox{\hyperlink{group___render_system_ga027109503a988ba85f4c63b55082907f}{Vertex\+Element\+Type}}}]{the\+Type,  }\item[{\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}}}]{semantic,  }\item[{unsigned short}]{index = {\ttfamily 0} }\end{DoxyParamCaption})}



Modify an element in-\/place, params as add\+Element. 

\begin{DoxyRemark}{Remarks}
{\bfseries{Please read the information in \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} about the importance of ordering and structure for compatibility with older D3D drivers}}. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a469bd849411d3f152d700772fab64501}\label{class_ogre_1_1_vertex_declaration_a469bd849411d3f152d700772fab64501}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!findElementBySemantic@{findElementBySemantic}}
\index{findElementBySemantic@{findElementBySemantic}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{findElementBySemantic()}{findElementBySemantic()}}
{\footnotesize\ttfamily const \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}}$\ast$ Ogre\+::\+Vertex\+Declaration\+::find\+Element\+By\+Semantic (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group___render_system_ga0a62b3f2ede8992ff365bb013a8bc00d}{Vertex\+Element\+Semantic}}}]{sem,  }\item[{unsigned short}]{index = {\ttfamily 0} }\end{DoxyParamCaption}) const}



Finds a \mbox{\hyperlink{class_ogre_1_1_vertex_element}{Vertex\+Element}} with the given semantic, and index if there is more than one element with the same semantic. 

\begin{DoxyRemark}{Remarks}
If the element is not found, this method returns null. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_ada92fbc9ee87b04f8a3c389c71904ce6}\label{class_ogre_1_1_vertex_declaration_ada92fbc9ee87b04f8a3c389c71904ce6}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!findElementsBySource@{findElementsBySource}}
\index{findElementsBySource@{findElementsBySource}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{findElementsBySource()}{findElementsBySource()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_vertex_declaration_a60080b97acb5b645bf3524152d75cc5d}{Vertex\+Element\+List}} Ogre\+::\+Vertex\+Declaration\+::find\+Elements\+By\+Source (\begin{DoxyParamCaption}\item[{unsigned short}]{source }\end{DoxyParamCaption}) const}



Based on the current elements, gets the size of the vertex for a given buffer source. 


\begin{DoxyParams}{Parameters}
{\em source} & The buffer binding index for which to get the vertex size. Gets a list of elements which use a given source. \\
\hline
\end{DoxyParams}
\begin{DoxyRemark}{Remarks}
Note that the list of elements is returned by value therefore is separate from the declaration as soon as this method returns. 
\end{DoxyRemark}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_ad34cfa2c7ebdadfb5101ce751e6ab039}\label{class_ogre_1_1_vertex_declaration_ad34cfa2c7ebdadfb5101ce751e6ab039}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getVertexSize@{getVertexSize}}
\index{getVertexSize@{getVertexSize}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getVertexSize()}{getVertexSize()}}
{\footnotesize\ttfamily size\+\_\+t Ogre\+::\+Vertex\+Declaration\+::get\+Vertex\+Size (\begin{DoxyParamCaption}\item[{unsigned short}]{source }\end{DoxyParamCaption}) const}



Gets the vertex size defined by this declaration for a given source. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a4f99e40285b5c122843b681477983ab1}\label{class_ogre_1_1_vertex_declaration_a4f99e40285b5c122843b681477983ab1}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!getNextFreeTextureCoordinate@{getNextFreeTextureCoordinate}}
\index{getNextFreeTextureCoordinate@{getNextFreeTextureCoordinate}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{getNextFreeTextureCoordinate()}{getNextFreeTextureCoordinate()}}
{\footnotesize\ttfamily unsigned short Ogre\+::\+Vertex\+Declaration\+::get\+Next\+Free\+Texture\+Coordinate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Return the index of the next free texture coordinate set which may be added to this declaration. 

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a3c1091f7ece9bbc4e4f847484fd75a37}\label{class_ogre_1_1_vertex_declaration_a3c1091f7ece9bbc4e4f847484fd75a37}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!clone@{clone}}
\index{clone@{clone}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{clone()}{clone()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}}$\ast$ Ogre\+::\+Vertex\+Declaration\+::clone (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_ogre_1_1_hardware_buffer_manager_base}{Hardware\+Buffer\+Manager\+Base}} $\ast$}]{mgr = {\ttfamily 0} }\end{DoxyParamCaption}) const}



Clones this declaration. 


\begin{DoxyParams}{Parameters}
{\em mgr} & Optional \mbox{\hyperlink{class_ogre_1_1_hardware_buffer_manager}{Hardware\+Buffer\+Manager}} to use for creating the clone (if null, use the current default). \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_aa8323ecd73a854f8c72fd6ac2618e3ee}\label{class_ogre_1_1_vertex_declaration_aa8323ecd73a854f8c72fd6ac2618e3ee}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!operator==@{operator==}}
\index{operator==@{operator==}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{operator==()}{operator==()}}
{\footnotesize\ttfamily bool Ogre\+::\+Vertex\+Declaration\+::operator== (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} \&}]{rhs }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_vertex_declaration_a1049733c9da2b8a49590b1f942c1b4ae}\label{class_ogre_1_1_vertex_declaration_a1049733c9da2b8a49590b1f942c1b4ae}} 
\index{Ogre::VertexDeclaration@{Ogre::VertexDeclaration}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!Ogre::VertexDeclaration@{Ogre::VertexDeclaration}}
\doxysubsubsection{\texorpdfstring{operator"!=()}{operator!=()}}
{\footnotesize\ttfamily bool Ogre\+::\+Vertex\+Declaration\+::operator!= (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{class_ogre_1_1_vertex_declaration}{Vertex\+Declaration}} \&}]{rhs }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{_ogre_hardware_vertex_buffer_8h}{Ogre\+Hardware\+Vertex\+Buffer.\+h}}\end{DoxyCompactItemize}
