\hypertarget{class_ogre_1_1_g_l_s_l_program_manager}{}\doxysection{Ogre\+::G\+L\+S\+L\+Program\+Manager Class Reference}
\label{class_ogre_1_1_g_l_s_l_program_manager}\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}


\mbox{\hyperlink{namespace_ogre}{Ogre}} assumes that there are separate vertex and fragment programs to deal with but \mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} has one program object that represents the active vertex and fragment shader objects during a rendering state.  




{\ttfamily \#include $<$Ogre\+G\+L\+S\+L\+Program\+Manager.\+h$>$}



Inheritance diagram for Ogre\+::G\+L\+S\+L\+Program\+Manager\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{class_ogre_1_1_g_l_s_l_program_manager__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_af4cf1c71b5c7e11e8b9fea6d2b0c99c2}{G\+L\+S\+L\+Program\+Manager}} (\mbox{\hyperlink{class_ogre_1_1_g_l3_plus_render_system}{G\+L3\+Plus\+Render\+System}} $\ast$render\+System)
\item 
\mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_a939666db3d50b0d022b97e478097c843}{$\sim$\+G\+L\+S\+L\+Program\+Manager}} ()
\item 
void \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_common_af0074b30d327b54e5f352ca64612a043}{destroy\+All\+By\+Shader}} (\mbox{\hyperlink{class_ogre_1_1_g_l_s_l_shader_common}{G\+L\+S\+L\+Shader\+Common}} $\ast$shader)
\begin{DoxyCompactList}\small\item\em Destroy all programs which referencing this shader. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_common_ae8a109b69705dcab009b69f6334c58b1}{extract\+Uniforms\+From\+G\+L\+SL}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \&src, \mbox{\hyperlink{struct_ogre_1_1_gpu_named_constants}{Gpu\+Named\+Constants}} \&constant\+Defs, const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \&filename)
\begin{DoxyCompactList}\small\item\em Populate a list of uniforms based on \mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} source and store them in \mbox{\hyperlink{struct_ogre_1_1_gpu_named_constants}{Gpu\+Named\+Constants}}. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_ae037685743a5d056213a9a391a7f91d6}{extract\+Uniforms\+From\+Program}} (G\+Luint program\+Object, const \mbox{\hyperlink{group___materials_gae4823c1377e5d4c312a3da9d1cb8534a}{Gpu\+Constant\+Definition\+Map}} $\ast$(\&constant\+Defs)\mbox{[}6\mbox{]}, \mbox{\hyperlink{namespace_ogre_ab6bb0d65dc078300d6e0459f926292b4}{G\+L\+Uniform\+Reference\+List}} \&uniform\+List, \mbox{\hyperlink{namespace_ogre_adb9443f0308cf797d752d4aad47d40f7}{G\+L\+Atomic\+Counter\+Reference\+List}} \&counter\+List, \mbox{\hyperlink{namespace_ogre_a0013629ba7e62b9f0ffb427b0db06059}{Shared\+Params\+Buffer\+Map}} \&shared\+Params\+Buffer\+Map, \mbox{\hyperlink{namespace_ogre_a1bd5e7fa02cc0018b170acf18fc7739f}{G\+L\+Counter\+Buffer\+List}} \&counter\+Buffer\+List)
\begin{DoxyCompactList}\small\item\em Populate a list of uniforms based on an Open\+GL program object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program}{G\+L\+S\+L\+Program}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_a5e4b46a534ca76e9a84ef4540c702fef}{get\+Active\+Program}} (void)
\begin{DoxyCompactList}\small\item\em Get the program object that links the two active shader objects together if a program object was not already created and linked a new one is created and linked. \end{DoxyCompactList}\item 
\mbox{\hyperlink{class_ogre_1_1_g_l3_plus_state_cache_manager}{G\+L3\+Plus\+State\+Cache\+Manager}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_a5268e2dfb7df77597f023f4f7345613a}{get\+State\+Cache\+Manager}} ()
\item 
void \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_a78d6d8907fbe0ccd193353f84d7c66c3}{set\+Active\+Shader}} (\mbox{\hyperlink{group___resources_gad08e89fa63e81d061ea9e2f37664976e}{Gpu\+Program\+Type}} type, \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_shader}{G\+L\+S\+L\+Shader}} $\ast$shader)
\begin{DoxyCompactList}\small\item\em Set the shader for the next rendering state. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager}{G\+L\+S\+L\+Program\+Manager}} \& \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_a65bbd8b2898d2d8531170426ee437889}{get\+Singleton}} (void)
\item 
static \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager}{G\+L\+S\+L\+Program\+Manager}} $\ast$ \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager_ae8afd2bece4f87e1fbac186c275ac8db}{get\+Singleton\+Ptr}} (void)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\mbox{\hyperlink{namespace_ogre}{Ogre}} assumes that there are separate vertex and fragment programs to deal with but \mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} has one program object that represents the active vertex and fragment shader objects during a rendering state. 

\mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} Vertex and fragment shader objects are compiled separately and then attached to a program object and then the program object is linked. Since \mbox{\hyperlink{namespace_ogre}{Ogre}} can only handle one vertex program and one fragment program being active in a pass, the \mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} Link Program Manager does the same. The \mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} Link program manager acts as a state machine and activates a program object based on the active vertex and fragment program. Previously created program objects are stored along with a unique key in a hash\+\_\+map for quick retrieval the next time the program object is required. 

\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_af4cf1c71b5c7e11e8b9fea6d2b0c99c2}\label{class_ogre_1_1_g_l_s_l_program_manager_af4cf1c71b5c7e11e8b9fea6d2b0c99c2}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!GLSLProgramManager@{GLSLProgramManager}}
\index{GLSLProgramManager@{GLSLProgramManager}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{GLSLProgramManager()}{GLSLProgramManager()}}
{\footnotesize\ttfamily Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::\+G\+L\+S\+L\+Program\+Manager (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_ogre_1_1_g_l3_plus_render_system}{G\+L3\+Plus\+Render\+System}} $\ast$}]{render\+System }\end{DoxyParamCaption})}

\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_a939666db3d50b0d022b97e478097c843}\label{class_ogre_1_1_g_l_s_l_program_manager_a939666db3d50b0d022b97e478097c843}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!````~GLSLProgramManager@{$\sim$GLSLProgramManager}}
\index{````~GLSLProgramManager@{$\sim$GLSLProgramManager}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{$\sim$GLSLProgramManager()}{~GLSLProgramManager()}}
{\footnotesize\ttfamily Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::$\sim$\+G\+L\+S\+L\+Program\+Manager (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_a5e4b46a534ca76e9a84ef4540c702fef}\label{class_ogre_1_1_g_l_s_l_program_manager_a5e4b46a534ca76e9a84ef4540c702fef}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!getActiveProgram@{getActiveProgram}}
\index{getActiveProgram@{getActiveProgram}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{getActiveProgram()}{getActiveProgram()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program}{G\+L\+S\+L\+Program}}$\ast$ Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::get\+Active\+Program (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Get the program object that links the two active shader objects together if a program object was not already created and linked a new one is created and linked. 

\begin{DoxyNote}{Note}
this method does N\+OT link seperable programs. 
\end{DoxyNote}
\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_a78d6d8907fbe0ccd193353f84d7c66c3}\label{class_ogre_1_1_g_l_s_l_program_manager_a78d6d8907fbe0ccd193353f84d7c66c3}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!setActiveShader@{setActiveShader}}
\index{setActiveShader@{setActiveShader}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{setActiveShader()}{setActiveShader()}}
{\footnotesize\ttfamily void Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::set\+Active\+Shader (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group___resources_gad08e89fa63e81d061ea9e2f37664976e}{Gpu\+Program\+Type}}}]{type,  }\item[{\mbox{\hyperlink{class_ogre_1_1_g_l_s_l_shader}{G\+L\+S\+L\+Shader}} $\ast$}]{shader }\end{DoxyParamCaption})}



Set the shader for the next rendering state. 

The active program object will be cleared. Normally called from the \mbox{\hyperlink{class_ogre_1_1_g_l_render_system_aac0ea19643a55921a6fd968bb698d7fb}{G\+L\+Render\+System\+::bind\+Gpu\+Program}} and unbind\+Program methods \mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_ae037685743a5d056213a9a391a7f91d6}\label{class_ogre_1_1_g_l_s_l_program_manager_ae037685743a5d056213a9a391a7f91d6}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!extractUniformsFromProgram@{extractUniformsFromProgram}}
\index{extractUniformsFromProgram@{extractUniformsFromProgram}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{extractUniformsFromProgram()}{extractUniformsFromProgram()}}
{\footnotesize\ttfamily void Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::extract\+Uniforms\+From\+Program (\begin{DoxyParamCaption}\item[{G\+Luint}]{program\+Object,  }\item[{const \mbox{\hyperlink{group___materials_gae4823c1377e5d4c312a3da9d1cb8534a}{Gpu\+Constant\+Definition\+Map}} $\ast$(\&)}]{constant\+Defs\mbox{[}6\mbox{]},  }\item[{\mbox{\hyperlink{namespace_ogre_ab6bb0d65dc078300d6e0459f926292b4}{G\+L\+Uniform\+Reference\+List}} \&}]{uniform\+List,  }\item[{\mbox{\hyperlink{namespace_ogre_adb9443f0308cf797d752d4aad47d40f7}{G\+L\+Atomic\+Counter\+Reference\+List}} \&}]{counter\+List,  }\item[{\mbox{\hyperlink{namespace_ogre_a0013629ba7e62b9f0ffb427b0db06059}{Shared\+Params\+Buffer\+Map}} \&}]{shared\+Params\+Buffer\+Map,  }\item[{\mbox{\hyperlink{namespace_ogre_a1bd5e7fa02cc0018b170acf18fc7739f}{G\+L\+Counter\+Buffer\+List}} \&}]{counter\+Buffer\+List }\end{DoxyParamCaption})}



Populate a list of uniforms based on an Open\+GL program object. 

\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_a5268e2dfb7df77597f023f4f7345613a}\label{class_ogre_1_1_g_l_s_l_program_manager_a5268e2dfb7df77597f023f4f7345613a}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!getStateCacheManager@{getStateCacheManager}}
\index{getStateCacheManager@{getStateCacheManager}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{getStateCacheManager()}{getStateCacheManager()}}
{\footnotesize\ttfamily \mbox{\hyperlink{class_ogre_1_1_g_l3_plus_state_cache_manager}{G\+L3\+Plus\+State\+Cache\+Manager}}$\ast$ Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::get\+State\+Cache\+Manager (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_a65bbd8b2898d2d8531170426ee437889}\label{class_ogre_1_1_g_l_s_l_program_manager_a65bbd8b2898d2d8531170426ee437889}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!getSingleton@{getSingleton}}
\index{getSingleton@{getSingleton}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{getSingleton()}{getSingleton()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager}{G\+L\+S\+L\+Program\+Manager}}\& Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::get\+Singleton (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_ae8afd2bece4f87e1fbac186c275ac8db}\label{class_ogre_1_1_g_l_s_l_program_manager_ae8afd2bece4f87e1fbac186c275ac8db}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!getSingletonPtr@{getSingletonPtr}}
\index{getSingletonPtr@{getSingletonPtr}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{getSingletonPtr()}{getSingletonPtr()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{class_ogre_1_1_g_l_s_l_program_manager}{G\+L\+S\+L\+Program\+Manager}}$\ast$ Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+::get\+Singleton\+Ptr (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}

\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_common_ae8a109b69705dcab009b69f6334c58b1}\label{class_ogre_1_1_g_l_s_l_program_manager_common_ae8a109b69705dcab009b69f6334c58b1}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!extractUniformsFromGLSL@{extractUniformsFromGLSL}}
\index{extractUniformsFromGLSL@{extractUniformsFromGLSL}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{extractUniformsFromGLSL()}{extractUniformsFromGLSL()}}
{\footnotesize\ttfamily void Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+Common\+::extract\+Uniforms\+From\+G\+L\+SL (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \&}]{src,  }\item[{\mbox{\hyperlink{struct_ogre_1_1_gpu_named_constants}{Gpu\+Named\+Constants}} \&}]{constant\+Defs,  }\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \&}]{filename }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inherited]}}



Populate a list of uniforms based on \mbox{\hyperlink{namespace_ogre_1_1_g_l_s_l}{G\+L\+SL}} source and store them in \mbox{\hyperlink{struct_ogre_1_1_gpu_named_constants}{Gpu\+Named\+Constants}}. 

~\newline
 
\begin{DoxyParams}{Parameters}
{\em src} & Reference to the source code. \\
\hline
{\em constant\+Defs} & The defs to populate (will not be cleared before adding, clear it yourself before calling this if that\textquotesingle{}s what you want). ~\newline
 \\
\hline
{\em filename} & The file name this came from, for logging errors. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{class_ogre_1_1_g_l_s_l_program_manager_common_af0074b30d327b54e5f352ca64612a043}\label{class_ogre_1_1_g_l_s_l_program_manager_common_af0074b30d327b54e5f352ca64612a043}} 
\index{Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}!destroyAllByShader@{destroyAllByShader}}
\index{destroyAllByShader@{destroyAllByShader}!Ogre::GLSLProgramManager@{Ogre::GLSLProgramManager}}
\doxysubsubsection{\texorpdfstring{destroyAllByShader()}{destroyAllByShader()}}
{\footnotesize\ttfamily void Ogre\+::\+G\+L\+S\+L\+Program\+Manager\+Common\+::destroy\+All\+By\+Shader (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_ogre_1_1_g_l_s_l_shader_common}{G\+L\+S\+L\+Shader\+Common}} $\ast$}]{shader }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inherited]}}



Destroy all programs which referencing this shader. 



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