\hypertarget{class_ogre_1_1_g_l_state_cache_manager_common}{}\doxysection{Ogre\+::G\+L\+State\+Cache\+Manager\+Common Class Reference}
\label{class_ogre_1_1_g_l_state_cache_manager_common}\index{Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}}


An in memory cache of the Open\+GL state.  




{\ttfamily \#include $<$Ogre\+G\+L\+State\+Cache\+Manager\+Common.\+h$>$}



Inheritance diagram for Ogre\+::G\+L\+State\+Cache\+Manager\+Common\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_ogre_1_1_g_l_state_cache_manager_common__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual \mbox{\hyperlink{class_ogre_1_1_g_l_state_cache_manager_common_a8fd43e7bcc25c811bceb407e00994a68}{$\sim$\+G\+L\+State\+Cache\+Manager\+Common}} ()
\item 
\mbox{\hyperlink{namespace_ogre_a07f1f7c1d84d58c9beae02e1ebb945e4}{uchar}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_g_l_state_cache_manager_common_aed0a1810279e037e0c7b12f9ffc0c65e}{get\+Colour\+Mask}} ()
\begin{DoxyCompactList}\small\item\em Gets the current colour mask setting. \end{DoxyCompactList}\item 
\mbox{\hyperlink{namespace_ogre_a07f1f7c1d84d58c9beae02e1ebb945e4}{uchar}} \mbox{\hyperlink{class_ogre_1_1_g_l_state_cache_manager_common_a6176362b2fcb20cccafc9821951778ee}{get\+Depth\+Mask}} () const
\begin{DoxyCompactList}\small\item\em Gets the current depth mask setting. \end{DoxyCompactList}\item 
\mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} \mbox{\hyperlink{class_ogre_1_1_g_l_state_cache_manager_common_a01d78d20763464f69a157b0c81ba454f}{get\+Stencil\+Mask}} (void) const
\begin{DoxyCompactList}\small\item\em Gets the current stencil mask. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_g_l_state_cache_manager_common_a8cf8ecd02d3f7d9ecbda6decdabc09d8}{get\+Viewport}} (int $\ast$array)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
An in memory cache of the Open\+GL state. 

State changes can be particularly expensive time wise. This is because a change requires Open\+GL to re-\/evaluate and update the state machine. Because of the general purpose nature of O\+G\+RE we often set the state for a specific texture, material, buffer, etc. But this may be the same as the current status of the state machine and is therefore redundant and causes unnecessary work to be performed by Open\+GL.

Instead we are caching the state so that we can check whether it actually does need to be updated. This leads to improved performance all around and can be somewhat dramatic in some cases.

\begin{DoxyWarning}{Warning}
caching does not work with multiple windows, sharing the same context. They will erroneously get different state caches. 
\end{DoxyWarning}


\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_g_l_state_cache_manager_common_a8fd43e7bcc25c811bceb407e00994a68}\label{class_ogre_1_1_g_l_state_cache_manager_common_a8fd43e7bcc25c811bceb407e00994a68}} 
\index{Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}!````~GLStateCacheManagerCommon@{$\sim$GLStateCacheManagerCommon}}
\index{````~GLStateCacheManagerCommon@{$\sim$GLStateCacheManagerCommon}!Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}}
\doxysubsubsection{\texorpdfstring{$\sim$GLStateCacheManagerCommon()}{~GLStateCacheManagerCommon()}}
{\footnotesize\ttfamily virtual Ogre\+::\+G\+L\+State\+Cache\+Manager\+Common\+::$\sim$\+G\+L\+State\+Cache\+Manager\+Common (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_g_l_state_cache_manager_common_a8cf8ecd02d3f7d9ecbda6decdabc09d8}\label{class_ogre_1_1_g_l_state_cache_manager_common_a8cf8ecd02d3f7d9ecbda6decdabc09d8}} 
\index{Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}!getViewport@{getViewport}}
\index{getViewport@{getViewport}!Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}}
\doxysubsubsection{\texorpdfstring{getViewport()}{getViewport()}}
{\footnotesize\ttfamily void Ogre\+::\+G\+L\+State\+Cache\+Manager\+Common\+::get\+Viewport (\begin{DoxyParamCaption}\item[{int $\ast$}]{array }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_g_l_state_cache_manager_common_aed0a1810279e037e0c7b12f9ffc0c65e}\label{class_ogre_1_1_g_l_state_cache_manager_common_aed0a1810279e037e0c7b12f9ffc0c65e}} 
\index{Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}!getColourMask@{getColourMask}}
\index{getColourMask@{getColourMask}!Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}}
\doxysubsubsection{\texorpdfstring{getColourMask()}{getColourMask()}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespace_ogre_a07f1f7c1d84d58c9beae02e1ebb945e4}{uchar}}$\ast$ Ogre\+::\+G\+L\+State\+Cache\+Manager\+Common\+::get\+Colour\+Mask (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Gets the current colour mask setting. 

\begin{DoxyReturn}{Returns}
An array containing the mask in R\+G\+BA order. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_g_l_state_cache_manager_common_a6176362b2fcb20cccafc9821951778ee}\label{class_ogre_1_1_g_l_state_cache_manager_common_a6176362b2fcb20cccafc9821951778ee}} 
\index{Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}!getDepthMask@{getDepthMask}}
\index{getDepthMask@{getDepthMask}!Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}}
\doxysubsubsection{\texorpdfstring{getDepthMask()}{getDepthMask()}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespace_ogre_a07f1f7c1d84d58c9beae02e1ebb945e4}{uchar}} Ogre\+::\+G\+L\+State\+Cache\+Manager\+Common\+::get\+Depth\+Mask (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Gets the current depth mask setting. 

\begin{DoxyReturn}{Returns}
The current depth mask. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_g_l_state_cache_manager_common_a01d78d20763464f69a157b0c81ba454f}\label{class_ogre_1_1_g_l_state_cache_manager_common_a01d78d20763464f69a157b0c81ba454f}} 
\index{Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}!getStencilMask@{getStencilMask}}
\index{getStencilMask@{getStencilMask}!Ogre::GLStateCacheManagerCommon@{Ogre::GLStateCacheManagerCommon}}
\doxysubsubsection{\texorpdfstring{getStencilMask()}{getStencilMask()}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespace_ogre_adf2a0cf2e77143b5ee1d38a75e289545}{uint32}} Ogre\+::\+G\+L\+State\+Cache\+Manager\+Common\+::get\+Stencil\+Mask (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Gets the current stencil mask. 

\begin{DoxyReturn}{Returns}
The stencil mask. 
\end{DoxyReturn}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{_ogre_g_l_state_cache_manager_common_8h}{Ogre\+G\+L\+State\+Cache\+Manager\+Common.\+h}}\end{DoxyCompactItemize}
