\hypertarget{a01418}{\section{A\+C\+G\+:\+:Scene\+Graph\+:\+:A\+C\+G\+:\+:Vertex\+Declaration Class Reference}
\label{a01418}\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
}


Class to define the vertex input layout.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{a01418_a41046d2e0cdd29a489a6fc5b91736fba}{add\+Element} (const \hyperlink{a01420}{Vertex\+Element} $\ast$\+\_\+p\+Element)
\item 
void \hyperlink{a01418_a6b1e6f501a37bb49a6ae90b744640828}{add\+Element} (unsigned int \+\_\+type, unsigned int \+\_\+num\+Elements, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122a}{V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E} \+\_\+usage, const void $\ast$\+\_\+pointer, const char $\ast$\+\_\+shader\+Input\+Name=0, unsigned int \+\_\+divisor=0, unsigned int \+\_\+vbo=0)
\item 
void \hyperlink{a01418_a96a7e250cd106e800514ed4b4449401b}{add\+Element} (unsigned int \+\_\+type, unsigned int \+\_\+num\+Elements, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122a}{V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E} \+\_\+usage, size\+\_\+t \+\_\+byte\+Offset=0, const char $\ast$\+\_\+shader\+Input\+Name=0, unsigned int \+\_\+divisor=0, unsigned int \+\_\+vbo=0)
\item 
void \hyperlink{a01418_a40be20c8e20b7435eeecbf5e0d588340}{add\+Elements} (unsigned int \+\_\+num\+Elements, const \hyperlink{a01420}{Vertex\+Element} $\ast$\+\_\+p\+Elements)
\item 
void \hyperlink{a01418_aeae14b93dd8baf2c66244471c8edc749}{clear} ()
\item 
void \hyperlink{a01418_a36b04e9bc6e563324d88d33e743b92ff}{activate\+Fixed\+Function} () const 
\item 
void \hyperlink{a01418_af6f4eeebc0e110c58f4c7df225369b8b}{deactivate\+Fixed\+Function} () const 
\item 
void \hyperlink{a01418_a684c941d3f195f5f79e8b991ef8f2df3}{activate\+Shader\+Pipeline} (\hyperlink{a01019}{G\+L\+S\+L\+::\+Program} $\ast$\+\_\+prog) const 
\item 
void \hyperlink{a01418_ae49b936e8f352c54ecf73256d0be88f6}{deactivate\+Shader\+Pipeline} (\hyperlink{a01019}{G\+L\+S\+L\+::\+Program} $\ast$\+\_\+prog) const 
\item 
void \hyperlink{a01418_a864a5239abf4e9103cbd6f185a03514b}{set\+Vertex\+Stride} (unsigned int \+\_\+stride)
\item 
unsigned int \hyperlink{a01418_a4ff8892bec3e25d4a0d4af9ae3ff17ad}{get\+Vertex\+Stride} (unsigned int i=0) const 
\item 
unsigned int \hyperlink{a01418_ae745369172dc56555845eab197682d85}{get\+Num\+Elements} () const 
\item 
const \hyperlink{a01420}{Vertex\+Element} $\ast$ \hyperlink{a01418_ae4d668d54772dddc05e171a61af7ffbc}{get\+Element} (unsigned int i) const 
\item 
int \hyperlink{a01418_a3e9ec57b8a7831460573794fe0610d54}{find\+Element\+Id\+By\+Usage} (\hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122a}{V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E} \+\_\+usage) const 
\item 
const \hyperlink{a01420}{Vertex\+Element} $\ast$ \hyperlink{a01418_ada40e6c6334d7ceab8805e9f04ee0dee}{find\+Element\+By\+Usage} (\hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122a}{V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E} \+\_\+usage) const 
\item 
Q\+String \hyperlink{a01418_a5d1bc2863ce86109f386ba7a6eeba7e9}{to\+String} () const 
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static unsigned int \hyperlink{a01418_a4c94e8f565247d4b6a66b8bc1a92fa39}{get\+G\+L\+Type\+Size} (unsigned int \+\_\+type)
\item 
static unsigned int \hyperlink{a01418_a1fa0aaf3cd9d907ea847c56aa3b83ff1}{get\+Element\+Size} (const \hyperlink{a01420}{Vertex\+Element} $\ast$\+\_\+p\+Element)
\item 
static bool \hyperlink{a01418_a2182d71eacf2d573b46daf1dd394aad3}{supports\+Instanced\+Arrays} ()
\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{a01418_ab6ab9dd591e7ad24dd1787ce5b64f348}{update\+Offsets} ()
\item 
void \hyperlink{a01418_a9122bb4cd8ddcfc336b23d54553b056b}{update\+Shader\+Input\+Name} (\hyperlink{a01420}{Vertex\+Element} $\ast$\+\_\+p\+Elem)
\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a01418_abeb890dee485bf7615f93a821d8a6755}{std\+::vector$<$ \hyperlink{a01420}{Vertex\+Element} $>$ {\bfseries elements\+\_\+}}\label{a01418_abeb890dee485bf7615f93a821d8a6755}

\item 
\hypertarget{a01418_a9c7ceae043063a8812217d4459250dc5}{unsigned int \hyperlink{a01418_a9c7ceae043063a8812217d4459250dc5}{vertex\+Stride\+\_\+}}\label{a01418_a9c7ceae043063a8812217d4459250dc5}

\begin{DoxyCompactList}\small\item\em Offset in bytes between each vertex. \end{DoxyCompactList}\item 
\hypertarget{a01418_af907b402f464e06f0d85efa8576bd37f}{std\+::map$<$ unsigned int, \\*
unsigned int $>$ \hyperlink{a01418_af907b402f464e06f0d85efa8576bd37f}{vertex\+Strides\+V\+B\+O\+\_\+}}\label{a01418_af907b402f464e06f0d85efa8576bd37f}

\begin{DoxyCompactList}\small\item\em Map vbo to offset in bytes between each vertex in that vbo. \end{DoxyCompactList}\item 
\hypertarget{a01418_af591230bce5592402585692a61142869}{int \hyperlink{a01418_af591230bce5592402585692a61142869}{stride\+User\+Defined\+\_\+}}\label{a01418_af591230bce5592402585692a61142869}

\begin{DoxyCompactList}\small\item\em Flag that indicates, whether the stride was set by user or derived automatically. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Class to define the vertex input layout. 

This class is used to specify vertex data layout (normals,positions,...).

The layout of a vertex buffer typically includes\+:
\begin{DoxyItemize}
\item number of vertex elements
\item element usage (position, normal, ... )
\item element types (float, int, ...)
\item memory alignment
\item data pointers (only in case of system memory buffers)
\item source vertex buffers
\item divisor (step rate) for instance data
\item vertex stride
\end{DoxyItemize}

Example usage\+: Interleaved vertex data

Create a vertex declaration given the following vertex data\+: 
\begin{DoxyCode}
Vertex
\{
  float4 pos
  float3 normal
  float2 texcoord
  ubyte4 color
  float4 tangent
  float2 texcoord2
\}
\end{DoxyCode}


The accompanying vertex declaration is created as follows\+: 
\begin{DoxyCode}
VertexDeclaration decl;
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa50a4029397cce53cd0ebb727e5165a5c}{VERTEX\_USAGE\_POSITION});
decl.addElement(GL\_FLOAT, 3, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa0339cb865b55fd11e0bb1bd399f408be}{VERTEX\_USAGE\_NORMAL});
decl.addElement(GL\_FLOAT, 2, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aab44a0a514fea53313de54ef79e549756}{VERTEX\_USAGE\_TEXCOORD});
decl.addElement(GL\_UNSIGNED\_BYTE, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa4b21ea5dc7270209b96bdcc7555f0ec0}{VERTEX\_USAGE\_COLOR});
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aafa3293a2b16c5e0fdca7d9282ee8409b}{VERTEX\_USAGE\_SHADER\_INPUT}, 0U, \textcolor{stringliteral}{"inTangent"});
decl.addElement(GL\_FLOAT, 2, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aafa3293a2b16c5e0fdca7d9282ee8409b}{VERTEX\_USAGE\_SHADER\_INPUT}, 0U, \textcolor{stringliteral}{"inTexcoord2"});
\end{DoxyCode}


Note that the element offsets are automatically computed, but it is possible to provide them manually of course.

These elements are then available in a vertex shader with the following input semantics\+: 
\begin{DoxyCode}
in vec4 inPosition;
...
in vec4 inTangent;
in vec2 inTexcoord2;
\end{DoxyCode}


V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E\+\_\+\+S\+H\+A\+D\+E\+R\+\_\+\+I\+N\+P\+U\+T is ignored in fixed function pipeline





Example usage\+: Multiple source buffers in system memory

Given are system memory buffers as vertex data source for drawing\+: 
\begin{DoxyCode}
float4* pVertexPositions;
ubyte4* pVertexColors;
float3* pVertexNormals;
\end{DoxyCode}


It is important that the vertex stride is manually set to 0!! and that the element data pointers are set accordingly\+:


\begin{DoxyCode}
VertexDeclaration decl;
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa50a4029397cce53cd0ebb727e5165a5c}{VERTEX\_USAGE\_POSITION}, pVertexPositions);
decl.addElement(GL\_FLOAT, 3, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa0339cb865b55fd11e0bb1bd399f408be}{VERTEX\_USAGE\_NORMAL}, pVertexNormals);
decl.addElement(GL\_UNSIGNED\_BYTE, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa4b21ea5dc7270209b96bdcc7555f0ec0}{VERTEX\_USAGE\_COLOR}, pVertexColors);
decl.setVertexStride(0);
\end{DoxyCode}


Note\+:
\begin{DoxyItemize}
\item vertex stride = 0
\item assign data address in vertex elements and don't change the data location later
\item order of elements is not important in this case
\item mixing interleaved vbo and system memory elements in the same declaration is forbidden 


\end{DoxyItemize}

Example usage\+: Instancing from vbo

\hyperlink{a03340}{Geometry} instancing can be implemented in several ways\+:
\begin{DoxyItemize}
\item compute instance transform procedurally from gl\+\_\+\+Instance\+I\+D in shader
\item store per instance data in a texture and use vertex texture fetch via gl\+\_\+\+Instance\+I\+D
\item store per instance data in a vbo and stream these as input to a vertex shader (A\+R\+B\+\_\+instanced\+\_\+arrays).
\end{DoxyItemize}

The first two methods can be implemented without modifying the vertex declaration, so this example focuses on the last method, in which instance data is streamed from a vbo.

Given a mesh with the following vertex elements\+: 
\begin{DoxyCode}
Vertex
\{
  float4 pos
  float3 normal
  float2 texcoord
\}
\end{DoxyCode}


Each instance of this mesh should have a different world transform and a different color. So the per instance data is\+: 
\begin{DoxyCode}
InstanceData
\{
  mat4 modelview
  uint color
\}
\end{DoxyCode}


This per instance data is stored in a separate G\+L\+\_\+\+A\+R\+R\+A\+Y\+\_\+\+B\+U\+F\+F\+E\+R vbo.

So there are two vbos involved in the draw call\+: geometry\+V\+B\+O -\/ stores static Vertex data of the mesh instance\+V\+B\+O -\/ stores Instance\+Data for each instance

The vertex declaration for the instanced draw call is initialized as follows\+:


\begin{DoxyCode}
VertexDeclaration decl;
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa50a4029397cce53cd0ebb727e5165a5c}{VERTEX\_USAGE\_POSITION}, 0U, 0, 0, geometryVBO.id()); \textcolor{comment}{//
       mesh vertex data layout}
decl.addElement(GL\_FLOAT, 3, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa0339cb865b55fd11e0bb1bd399f408be}{VERTEX\_USAGE\_NORMAL}, 0U, 0, 0, geometryVBO.id());
decl.addElement(GL\_FLOAT, 2, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aab44a0a514fea53313de54ef79e549756}{VERTEX\_USAGE\_TEXCOORD}, 0U, 0, 0, geometryVBO.id());

decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aafa3293a2b16c5e0fdca7d9282ee8409b}{VERTEX\_USAGE\_SHADER\_INPUT}, 0U, \textcolor{stringliteral}{"inModelView0"}, 1, 
      instanceVBO.id()); \textcolor{comment}{// instance data layout}
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aafa3293a2b16c5e0fdca7d9282ee8409b}{VERTEX\_USAGE\_SHADER\_INPUT}, 0U, \textcolor{stringliteral}{"inModelView1"}, 1, 
      instanceVBO.id());
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aafa3293a2b16c5e0fdca7d9282ee8409b}{VERTEX\_USAGE\_SHADER\_INPUT}, 0U, \textcolor{stringliteral}{"inModelView2"}, 1, 
      instanceVBO.id());
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aafa3293a2b16c5e0fdca7d9282ee8409b}{VERTEX\_USAGE\_SHADER\_INPUT}, 0U, \textcolor{stringliteral}{"inModelView3"}, 1, 
      instanceVBO.id());
decl.addElement(GL\_FLOAT, 4, \hyperlink{a03336_a8e20f3e5c21bdb768c1740315eeb122aa4b21ea5dc7270209b96bdcc7555f0ec0}{VERTEX\_USAGE\_COLOR}, 0U, 0, 1, instanceVBO.id());
\end{DoxyCode}


The 4x4 modelview matrix has to be split up into float4 elements.

Using this setup, a call to decl.\+activate\+Shader\+Pipeline() is enough to prepare an instanced draw call.

Finally, instancing requires a customized vertex shader that makes use of the per instance data\+: 
\begin{DoxyCode}
..
in vec4 inModelView0;
in vec4 inModelView1;
in vec4 inModelView2;
in vec4 inModelView3;
..

\textcolor{keywordtype}{void} main()
\{
  ..
  vec4 posVS;
  posVS.x = \hyperlink{a03368_a351b282a40719408090277956e526735}{dot}(inModelView0, inPosition);
  posVS.y = \hyperlink{a03368_a351b282a40719408090277956e526735}{dot}(inModelView1, inPosition);
  ..
  gl\_Position = projection * posVS;
\}
\end{DoxyCode}
 

Definition at line 266 of file Mesh\+Node2\+T.\+cc.



\subsection{Member Function Documentation}
\hypertarget{a01418_a36b04e9bc6e563324d88d33e743b92ff}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!activate\+Fixed\+Function@{activate\+Fixed\+Function}}
\index{activate\+Fixed\+Function@{activate\+Fixed\+Function}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{activate\+Fixed\+Function}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::activate\+Fixed\+Function (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{a01418_a36b04e9bc6e563324d88d33e743b92ff}
prepare Open\+G\+L to use a vertex buffer with this declaration -\/$>$ uses the fixed function pointers (gl\+Vertex\+Pointer, gl\+Color\+Pointer...) \hypertarget{a01418_a684c941d3f195f5f79e8b991ef8f2df3}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!activate\+Shader\+Pipeline@{activate\+Shader\+Pipeline}}
\index{activate\+Shader\+Pipeline@{activate\+Shader\+Pipeline}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{activate\+Shader\+Pipeline}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::activate\+Shader\+Pipeline (
\begin{DoxyParamCaption}
\item[{{\bf G\+L\+S\+L\+::\+Program} $\ast$}]{\+\_\+prog}
\end{DoxyParamCaption}
) const}}\label{a01418_a684c941d3f195f5f79e8b991ef8f2df3}
prepare Open\+G\+L to use a vertex buffer with this declaration -\/$>$ uses shader attribute pointers ( gl\+Vertex\+Attrib\+Pointer ) \hypertarget{a01418_a41046d2e0cdd29a489a6fc5b91736fba}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!add\+Element@{add\+Element}}
\index{add\+Element@{add\+Element}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{add\+Element}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::add\+Element (
\begin{DoxyParamCaption}
\item[{const {\bf Vertex\+Element} $\ast$}]{\+\_\+p\+Element}
\end{DoxyParamCaption}
)}}\label{a01418_a41046d2e0cdd29a489a6fc5b91736fba}
append one element to declaration \hypertarget{a01418_a6b1e6f501a37bb49a6ae90b744640828}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!add\+Element@{add\+Element}}
\index{add\+Element@{add\+Element}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{add\+Element}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::add\+Element (
\begin{DoxyParamCaption}
\item[{unsigned int}]{\+\_\+type, }
\item[{unsigned int}]{\+\_\+num\+Elements, }
\item[{{\bf V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E}}]{\+\_\+usage, }
\item[{const void $\ast$}]{\+\_\+pointer, }
\item[{const char $\ast$}]{\+\_\+shader\+Input\+Name = {\ttfamily 0}, }
\item[{unsigned int}]{\+\_\+divisor = {\ttfamily 0}, }
\item[{unsigned int}]{\+\_\+vbo = {\ttfamily 0}}
\end{DoxyParamCaption}
)}}\label{a01418_a6b1e6f501a37bb49a6ae90b744640828}
append one element to declarations, direct method \hypertarget{a01418_a96a7e250cd106e800514ed4b4449401b}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!add\+Element@{add\+Element}}
\index{add\+Element@{add\+Element}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{add\+Element}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::add\+Element (
\begin{DoxyParamCaption}
\item[{unsigned int}]{\+\_\+type, }
\item[{unsigned int}]{\+\_\+num\+Elements, }
\item[{{\bf V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E}}]{\+\_\+usage, }
\item[{size\+\_\+t}]{\+\_\+byte\+Offset = {\ttfamily 0}, }
\item[{const char $\ast$}]{\+\_\+shader\+Input\+Name = {\ttfamily 0}, }
\item[{unsigned int}]{\+\_\+divisor = {\ttfamily 0}, }
\item[{unsigned int}]{\+\_\+vbo = {\ttfamily 0}}
\end{DoxyParamCaption}
)}}\label{a01418_a96a7e250cd106e800514ed4b4449401b}
append one element to declarations, direct method \hypertarget{a01418_a40be20c8e20b7435eeecbf5e0d588340}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!add\+Elements@{add\+Elements}}
\index{add\+Elements@{add\+Elements}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{add\+Elements}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::add\+Elements (
\begin{DoxyParamCaption}
\item[{unsigned int}]{\+\_\+num\+Elements, }
\item[{const {\bf Vertex\+Element} $\ast$}]{\+\_\+p\+Elements}
\end{DoxyParamCaption}
)}}\label{a01418_a40be20c8e20b7435eeecbf5e0d588340}
append multiple element declarations \hypertarget{a01418_aeae14b93dd8baf2c66244471c8edc749}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!clear@{clear}}
\index{clear@{clear}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{clear}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::clear (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{a01418_aeae14b93dd8baf2c66244471c8edc749}
remove all vertex elements, also clears the user defined stride flag \hypertarget{a01418_af6f4eeebc0e110c58f4c7df225369b8b}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!deactivate\+Fixed\+Function@{deactivate\+Fixed\+Function}}
\index{deactivate\+Fixed\+Function@{deactivate\+Fixed\+Function}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{deactivate\+Fixed\+Function}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::deactivate\+Fixed\+Function (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{a01418_af6f4eeebc0e110c58f4c7df225369b8b}
disables vertex attributes to prevent any draw related crashes \hypertarget{a01418_ae49b936e8f352c54ecf73256d0be88f6}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!deactivate\+Shader\+Pipeline@{deactivate\+Shader\+Pipeline}}
\index{deactivate\+Shader\+Pipeline@{deactivate\+Shader\+Pipeline}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{deactivate\+Shader\+Pipeline}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::deactivate\+Shader\+Pipeline (
\begin{DoxyParamCaption}
\item[{{\bf G\+L\+S\+L\+::\+Program} $\ast$}]{\+\_\+prog}
\end{DoxyParamCaption}
) const}}\label{a01418_ae49b936e8f352c54ecf73256d0be88f6}
disables this vertex declaration to prevent any draw related crashes -\/$>$ calls gl\+Disable\+Vertex\+Attrib\+Array \hypertarget{a01418_ada40e6c6334d7ceab8805e9f04ee0dee}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!find\+Element\+By\+Usage@{find\+Element\+By\+Usage}}
\index{find\+Element\+By\+Usage@{find\+Element\+By\+Usage}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{find\+Element\+By\+Usage}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Vertex\+Element}$\ast$ A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::find\+Element\+By\+Usage (
\begin{DoxyParamCaption}
\item[{{\bf V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E}}]{\+\_\+usage}
\end{DoxyParamCaption}
) const}}\label{a01418_ada40e6c6334d7ceab8805e9f04ee0dee}
find element ptr by usage, return 0 if not found \hypertarget{a01418_a3e9ec57b8a7831460573794fe0610d54}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!find\+Element\+Id\+By\+Usage@{find\+Element\+Id\+By\+Usage}}
\index{find\+Element\+Id\+By\+Usage@{find\+Element\+Id\+By\+Usage}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{find\+Element\+Id\+By\+Usage}]{\setlength{\rightskip}{0pt plus 5cm}int A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::find\+Element\+Id\+By\+Usage (
\begin{DoxyParamCaption}
\item[{{\bf V\+E\+R\+T\+E\+X\+\_\+\+U\+S\+A\+G\+E}}]{\+\_\+usage}
\end{DoxyParamCaption}
) const}}\label{a01418_a3e9ec57b8a7831460573794fe0610d54}
find element id by usage, return -\/1 if not found \hypertarget{a01418_ae4d668d54772dddc05e171a61af7ffbc}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!get\+Element@{get\+Element}}
\index{get\+Element@{get\+Element}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{get\+Element}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf Vertex\+Element}$\ast$ A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::get\+Element (
\begin{DoxyParamCaption}
\item[{unsigned int}]{i}
\end{DoxyParamCaption}
) const}}\label{a01418_ae4d668d54772dddc05e171a61af7ffbc}
get the i'th vertex element desc \hypertarget{a01418_a1fa0aaf3cd9d907ea847c56aa3b83ff1}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!get\+Element\+Size@{get\+Element\+Size}}
\index{get\+Element\+Size@{get\+Element\+Size}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{get\+Element\+Size}]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::get\+Element\+Size (
\begin{DoxyParamCaption}
\item[{const {\bf Vertex\+Element} $\ast$}]{\+\_\+p\+Element}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{a01418_a1fa0aaf3cd9d907ea847c56aa3b83ff1}
get size of one vertex element \hypertarget{a01418_a4c94e8f565247d4b6a66b8bc1a92fa39}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!get\+G\+L\+Type\+Size@{get\+G\+L\+Type\+Size}}
\index{get\+G\+L\+Type\+Size@{get\+G\+L\+Type\+Size}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{get\+G\+L\+Type\+Size}]{\setlength{\rightskip}{0pt plus 5cm}static unsigned int A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::get\+G\+L\+Type\+Size (
\begin{DoxyParamCaption}
\item[{unsigned int}]{\+\_\+type}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{a01418_a4c94e8f565247d4b6a66b8bc1a92fa39}
get size of G\+L\+\_\+\+F\+L\+O\+A\+T, G\+L\+\_\+\+I\+N\+T ... \hypertarget{a01418_ae745369172dc56555845eab197682d85}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!get\+Num\+Elements@{get\+Num\+Elements}}
\index{get\+Num\+Elements@{get\+Num\+Elements}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{get\+Num\+Elements}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::get\+Num\+Elements (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{a01418_ae745369172dc56555845eab197682d85}
get num of vertex elements \hypertarget{a01418_a4ff8892bec3e25d4a0d4af9ae3ff17ad}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!get\+Vertex\+Stride@{get\+Vertex\+Stride}}
\index{get\+Vertex\+Stride@{get\+Vertex\+Stride}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{get\+Vertex\+Stride}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::get\+Vertex\+Stride (
\begin{DoxyParamCaption}
\item[{unsigned int}]{i = {\ttfamily 0}}
\end{DoxyParamCaption}
) const}}\label{a01418_a4ff8892bec3e25d4a0d4af9ae3ff17ad}
get vertex size (for element i, for multi vbo support) \hypertarget{a01418_a864a5239abf4e9103cbd6f185a03514b}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!set\+Vertex\+Stride@{set\+Vertex\+Stride}}
\index{set\+Vertex\+Stride@{set\+Vertex\+Stride}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{set\+Vertex\+Stride}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::set\+Vertex\+Stride (
\begin{DoxyParamCaption}
\item[{unsigned int}]{\+\_\+stride}
\end{DoxyParamCaption}
)}}\label{a01418_a864a5239abf4e9103cbd6f185a03514b}
set vertex stride manually, otherwise it is computed from the vertex elements \hypertarget{a01418_a2182d71eacf2d573b46daf1dd394aad3}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!supports\+Instanced\+Arrays@{supports\+Instanced\+Arrays}}
\index{supports\+Instanced\+Arrays@{supports\+Instanced\+Arrays}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{supports\+Instanced\+Arrays}]{\setlength{\rightskip}{0pt plus 5cm}static bool A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::supports\+Instanced\+Arrays (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [static]}}}\label{a01418_a2182d71eacf2d573b46daf1dd394aad3}
Check hw support for streaming instance data from vbo \hypertarget{a01418_a5d1bc2863ce86109f386ba7a6eeba7e9}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!to\+String@{to\+String}}
\index{to\+String@{to\+String}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{to\+String}]{\setlength{\rightskip}{0pt plus 5cm}Q\+String A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::to\+String (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{a01418_a5d1bc2863ce86109f386ba7a6eeba7e9}
Returns a string describing the vertex format for debugging purpose. \hypertarget{a01418_ab6ab9dd591e7ad24dd1787ce5b64f348}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!update\+Offsets@{update\+Offsets}}
\index{update\+Offsets@{update\+Offsets}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{update\+Offsets}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::update\+Offsets (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}}}\label{a01418_ab6ab9dd591e7ad24dd1787ce5b64f348}
automatically computes byte offset for interleaved vertex elements and computes vertex stride \hypertarget{a01418_a9122bb4cd8ddcfc336b23d54553b056b}{\index{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}!update\+Shader\+Input\+Name@{update\+Shader\+Input\+Name}}
\index{update\+Shader\+Input\+Name@{update\+Shader\+Input\+Name}!A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration@{A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration}}
\subsubsection[{update\+Shader\+Input\+Name}]{\setlength{\rightskip}{0pt plus 5cm}void A\+C\+G\+::\+Scene\+Graph\+::\+A\+C\+G\+::\+Vertex\+Declaration\+::update\+Shader\+Input\+Name (
\begin{DoxyParamCaption}
\item[{{\bf Vertex\+Element} $\ast$}]{\+\_\+p\+Elem}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}}}\label{a01418_a9122bb4cd8ddcfc336b23d54553b056b}
automatically sets shader input name on passed element, if not provided 

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
A\+C\+G/\+Scenegraph/Mesh\+Node2\+T.\+cc\end{DoxyCompactItemize}
