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


Interface used to by the \mbox{\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}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_adafa196fd89b566090806bde188bbf33}{Gpu\+Buffer\+Allocator}} ()
\item 
virtual \mbox{\hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ab50e9928256ddbd09462938a7e13e3c8}{$\sim$\+Gpu\+Buffer\+Allocator}} ()
\item 
virtual void \mbox{\hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a3c10273ba4790cfbd48b93e2627f85c2}{allocate\+Vertex\+Buffers}} (\mbox{\hyperlink{class_ogre_1_1_terrain}{Terrain}} $\ast$for\+Terrain, size\+\_\+t num\+Vertices, \mbox{\hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr}} \&dest\+Pos, \mbox{\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 \mbox{\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 \mbox{\hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_ac70a9dbc1dcfc9c742c08a7714ed7fa3}{free\+Vertex\+Buffers}} (const \mbox{\hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr}} \&posbuf, const \mbox{\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 \mbox{\hyperlink{namespace_ogre_ae906cf8e579ba8ade19879ec05b1a456}{Hardware\+Index\+Buffer\+Shared\+Ptr}} \mbox{\hyperlink{class_ogre_1_1_terrain_1_1_gpu_buffer_allocator_a826a5d2848be329361177f0209c13a67}{get\+Shared\+Index\+Buffer}} (\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} batch\+Size, \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} vdatasize, size\+\_\+t vertex\+Increment, \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} xoffset, \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} yoffset, \mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}} num\+Skirt\+Rows\+Cols, \mbox{\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}


\doxysubsection{Detailed Description}
Interface used to by the \mbox{\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}


\doxysubsection{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::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}!GpuBufferAllocator@{GpuBufferAllocator}}
\index{GpuBufferAllocator@{GpuBufferAllocator}!Ogre::Terrain::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}}
\doxysubsubsection{\texorpdfstring{GpuBufferAllocator()}{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::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}!````~GpuBufferAllocator@{$\sim$GpuBufferAllocator}}
\index{````~GpuBufferAllocator@{$\sim$GpuBufferAllocator}!Ogre::Terrain::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}}
\doxysubsubsection{\texorpdfstring{$\sim$GpuBufferAllocator()}{~GpuBufferAllocator()}}
{\footnotesize\ttfamily virtual Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::$\sim$\+Gpu\+Buffer\+Allocator (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



\doxysubsection{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::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}!allocateVertexBuffers@{allocateVertexBuffers}}
\index{allocateVertexBuffers@{allocateVertexBuffers}!Ogre::Terrain::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}}
\doxysubsubsection{\texorpdfstring{allocateVertexBuffers()}{allocateVertexBuffers()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::allocate\+Vertex\+Buffers (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_ogre_1_1_terrain}{Terrain}} $\ast$}]{for\+Terrain,  }\item[{size\+\_\+t}]{num\+Vertices,  }\item[{\mbox{\hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr}} \&}]{dest\+Pos,  }\item[{\mbox{\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 \mbox{\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::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}!freeVertexBuffers@{freeVertexBuffers}}
\index{freeVertexBuffers@{freeVertexBuffers}!Ogre::Terrain::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}}
\doxysubsubsection{\texorpdfstring{freeVertexBuffers()}{freeVertexBuffers()}}
{\footnotesize\ttfamily virtual void Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::free\+Vertex\+Buffers (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_a05ef9b65d4ed446b994636e371bf5aab}{Hardware\+Vertex\+Buffer\+Shared\+Ptr}} \&}]{posbuf,  }\item[{const \mbox{\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 \mbox{\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::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}!getSharedIndexBuffer@{getSharedIndexBuffer}}
\index{getSharedIndexBuffer@{getSharedIndexBuffer}!Ogre::Terrain::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}}
\doxysubsubsection{\texorpdfstring{getSharedIndexBuffer()}{getSharedIndexBuffer()}}
{\footnotesize\ttfamily virtual \mbox{\hyperlink{namespace_ogre_ae906cf8e579ba8ade19879ec05b1a456}{Hardware\+Index\+Buffer\+Shared\+Ptr}} Ogre\+::\+Terrain\+::\+Gpu\+Buffer\+Allocator\+::get\+Shared\+Index\+Buffer (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}}]{batch\+Size,  }\item[{\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}}]{vdatasize,  }\item[{size\+\_\+t}]{vertex\+Increment,  }\item[{\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}}]{xoffset,  }\item[{\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}}]{yoffset,  }\item[{\mbox{\hyperlink{namespace_ogre_aa8263b218e7d187ad5ef03a73a6ad7fd}{uint16}}}]{num\+Skirt\+Rows\+Cols,  }\item[{\mbox{\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 \mbox{\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::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}!freeAllBuffers@{freeAllBuffers}}
\index{freeAllBuffers@{freeAllBuffers}!Ogre::Terrain::GpuBufferAllocator@{Ogre::Terrain::GpuBufferAllocator}}
\doxysubsubsection{\texorpdfstring{freeAllBuffers()}{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 \mbox{\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 
\mbox{\hyperlink{_ogre_terrain_8h}{Ogre\+Terrain.\+h}}\end{DoxyCompactItemize}
