\hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator}{}\section{Ogre\+:\+:Terrain\+:\+:Gpu\+Buffer\+Allocator Class Reference}
\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator}\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}


Interface used to by the \hyperlink{class_ogre_1_1_terrain}{Terrain} instance to allocate G\+PU buffers.  




{\ttfamily \#include $<$Ogre\+Terrain.\+h$>$}



Inheritance diagram for Ogre\+:\+:Terrain\+:\+:Gpu\+Buffer\+Allocator\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=220pt]{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator__inherit__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_adafa196fd89b566090806bde188bbf33}{Gpu\+Buffer\+Allocator} ()
\item 
virtual \hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ab50e9928256ddbd09462938a7e13e3c8}{$\sim$\+Gpu\+Buffer\+Allocator} ()
\item 
virtual void \hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a3c10273ba4790cfbd48b93e2627f85c2}{allocate\+Vertex\+Buffers} (\hyperlink{class_ogre_1_1_terrain}{Terrain} $\ast$for\+Terrain, size\+\_\+t num\+Vertices, \hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&dest\+Pos, \hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&dest\+Delta)=0
\begin{DoxyCompactList}\small\item\em Allocate (or reuse) vertex buffers for a terrain L\+OD. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac35a15958d618f6e9cb9b2ca6663e219}{free\+All\+Buffers} ()=0
\begin{DoxyCompactList}\small\item\em Free any buffers we\textquotesingle{}re holding. \end{DoxyCompactList}\item 
virtual void \hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac70a9dbc1dcfc9c742c08a7714ed7fa3}{free\+Vertex\+Buffers} (const \hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&posbuf, const \hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&deltabuf)=0
\begin{DoxyCompactList}\small\item\em Free (or return to the pool) vertex buffers for terrain. \end{DoxyCompactList}\item 
virtual \hyperlink{namespace_ogre_ae906cf8e579ba8ade19879ec05b1a456}{Hardware\+Index\+Buffer\+Shared\+Ptr} \hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a826a5d2848be329361177f0209c13a67}{get\+Shared\+Index\+Buffer} (\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} batch\+Size, \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} vdatasize, size\+\_\+t vertex\+Increment, \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} xoffset, \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} yoffset, \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} num\+Skirt\+Rows\+Cols, \hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16} skirt\+Row\+Col\+Skip)=0
\begin{DoxyCompactList}\small\item\em Get a shared index buffer for a given number of settings. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interface used to by the \hyperlink{class_ogre_1_1_terrain}{Terrain} instance to allocate G\+PU buffers. 

\begin{DoxyRemark}{Remarks}
This class exists to make it easier to re-\/use buffers between multiple instances of terrain. 
\end{DoxyRemark}


\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_adafa196fd89b566090806bde188bbf33}\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_adafa196fd89b566090806bde188bbf33}} 
\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}!Gpu\+Buffer\+Allocator@{Gpu\+Buffer\+Allocator}}
\index{Gpu\+Buffer\+Allocator@{Gpu\+Buffer\+Allocator}!Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}
\subsubsection{\texorpdfstring{Gpu\+Buffer\+Allocator()}{GpuBufferAllocator()}}
{\footnotesize\ttfamily Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::\+Gpu\+Buffer\+Allocator (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ab50e9928256ddbd09462938a7e13e3c8}\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ab50e9928256ddbd09462938a7e13e3c8}} 
\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}!````~Gpu\+Buffer\+Allocator@{$\sim$\+Gpu\+Buffer\+Allocator}}
\index{````~Gpu\+Buffer\+Allocator@{$\sim$\+Gpu\+Buffer\+Allocator}!Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}
\subsubsection{\texorpdfstring{$\sim$\+Gpu\+Buffer\+Allocator()}{~GpuBufferAllocator()}}
{\footnotesize\ttfamily virtual Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::$\sim$\+Gpu\+Buffer\+Allocator (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a3c10273ba4790cfbd48b93e2627f85c2}\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a3c10273ba4790cfbd48b93e2627f85c2}} 
\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}!allocate\+Vertex\+Buffers@{allocate\+Vertex\+Buffers}}
\index{allocate\+Vertex\+Buffers@{allocate\+Vertex\+Buffers}!Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}
\subsubsection{\texorpdfstring{allocate\+Vertex\+Buffers()}{allocateVertexBuffers()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::allocate\+Vertex\+Buffers (\begin{DoxyParamCaption}\item[{\hyperlink{class_ogre_1_1_terrain}{Terrain} $\ast$}]{for\+Terrain,  }\item[{size\+\_\+t}]{num\+Vertices,  }\item[{\hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&}]{dest\+Pos,  }\item[{\hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&}]{dest\+Delta }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Allocate (or reuse) vertex buffers for a terrain L\+OD. 


\begin{DoxyParams}{Parameters}
{\em num\+Vertices} & The total number of vertices \\
\hline
{\em dest\+Pos} & Pointer to a vertex buffer for positions, to be bound \\
\hline
{\em dest\+Delta} & Pointer to a vertex buffer for deltas, to be bound \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_terrain_1_1_default_gpu_buffer_allocator_aab7c65d2cb7af5c84670c996c389bffb}{Ogre\+::\+Terrain\+::\+Default\+Gpu\+Buffer\+Allocator}.

\mbox{\Hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac70a9dbc1dcfc9c742c08a7714ed7fa3}\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac70a9dbc1dcfc9c742c08a7714ed7fa3}} 
\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}!free\+Vertex\+Buffers@{free\+Vertex\+Buffers}}
\index{free\+Vertex\+Buffers@{free\+Vertex\+Buffers}!Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}
\subsubsection{\texorpdfstring{free\+Vertex\+Buffers()}{freeVertexBuffers()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::free\+Vertex\+Buffers (\begin{DoxyParamCaption}\item[{const \hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&}]{posbuf,  }\item[{const \hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr} \&}]{deltabuf }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Free (or return to the pool) vertex buffers for terrain. 



Implemented in \hyperlink{class_ogre_1_1_terrain_1_1_default_gpu_buffer_allocator_af98bc1200700effb840c37f3d7b60b6f}{Ogre\+::\+Terrain\+::\+Default\+Gpu\+Buffer\+Allocator}.

\mbox{\Hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a826a5d2848be329361177f0209c13a67}\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a826a5d2848be329361177f0209c13a67}} 
\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}!get\+Shared\+Index\+Buffer@{get\+Shared\+Index\+Buffer}}
\index{get\+Shared\+Index\+Buffer@{get\+Shared\+Index\+Buffer}!Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}
\subsubsection{\texorpdfstring{get\+Shared\+Index\+Buffer()}{getSharedIndexBuffer()}}
{\footnotesize\ttfamily virtual \hyperlink{namespace_ogre_ae906cf8e579ba8ade19879ec05b1a456}{Hardware\+Index\+Buffer\+Shared\+Ptr} Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::get\+Shared\+Index\+Buffer (\begin{DoxyParamCaption}\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{batch\+Size,  }\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{vdatasize,  }\item[{size\+\_\+t}]{vertex\+Increment,  }\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{xoffset,  }\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{yoffset,  }\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{num\+Skirt\+Rows\+Cols,  }\item[{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}]{skirt\+Row\+Col\+Skip }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Get a shared index buffer for a given number of settings. 

\begin{DoxyRemark}{Remarks}
Since all index structures are the same at the same L\+OD level and relative position, we can share index buffers. Therefore the buffer returned from this method does not need to be \textquotesingle{}freed\textquotesingle{} like the vertex buffers since it is never owned. 
\end{DoxyRemark}

\begin{DoxyParams}{Parameters}
{\em batch\+Size} & The batch size along one edge \\
\hline
{\em vdatasize} & The size of the referenced vertex data along one edge \\
\hline
{\em vertex\+Increment} & The number of vertices to increment for each new indexed row / column \\
\hline
{\em xoffset} & The x offset from the start of vdatasize, at that resolution \\
\hline
{\em yoffset} & The y offset from the start of vdatasize, at that resolution \\
\hline
{\em num\+Skirt\+Rows\+Cols} & Number of rows and columns of skirts \\
\hline
{\em skirt\+Row\+Col\+Skip} & The number of rows / cols to skip in between skirts \\
\hline
\end{DoxyParams}


Implemented in \hyperlink{class_ogre_1_1_terrain_1_1_default_gpu_buffer_allocator_a34f2a33f27ae8732c4b034047929f56f}{Ogre\+::\+Terrain\+::\+Default\+Gpu\+Buffer\+Allocator}.

\mbox{\Hypertarget{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac35a15958d618f6e9cb9b2ca6663e219}\label{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac35a15958d618f6e9cb9b2ca6663e219}} 
\index{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}!free\+All\+Buffers@{free\+All\+Buffers}}
\index{free\+All\+Buffers@{free\+All\+Buffers}!Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator@{Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator}}
\subsubsection{\texorpdfstring{free\+All\+Buffers()}{freeAllBuffers()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::free\+All\+Buffers (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Free any buffers we\textquotesingle{}re holding. 



Implemented in \hyperlink{class_ogre_1_1_terrain_1_1_default_gpu_buffer_allocator_a13c9b9478bc9a473ce46e0dc62e88854}{Ogre\+::\+Terrain\+::\+Default\+Gpu\+Buffer\+Allocator}.



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\hyperlink{_ogre_terrain_8h}{Ogre\+Terrain.\+h}\end{DoxyCompactItemize}
