\hypertarget{a03358}{\section{G\+L\+S\+L Namespace Reference}
\label{a03358}\index{G\+L\+S\+L@{G\+L\+S\+L}}
}


This namespace contains all the classes and functions for handling \hyperlink{a03358}{G\+L\+S\+L} shader and program objects.  


\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
class \hyperlink{a00448}{Compute\+Shader}
\begin{DoxyCompactList}\small\item\em \hyperlink{a03358}{G\+L\+S\+L} compute shader. \end{DoxyCompactList}\item 
class \hyperlink{a00601}{Fragment\+Shader}
\begin{DoxyCompactList}\small\item\em \hyperlink{a03358}{G\+L\+S\+L} fragment shader. \end{DoxyCompactList}\item 
class \hyperlink{a00630}{Geometry\+Shader}
\begin{DoxyCompactList}\small\item\em \hyperlink{a03358}{G\+L\+S\+L} geometry shader. \end{DoxyCompactList}\item 
class \hyperlink{a01020}{Program}
\begin{DoxyCompactList}\small\item\em \hyperlink{a03358}{G\+L\+S\+L} program class. \end{DoxyCompactList}\item 
class \hyperlink{a01155}{Shader}
\begin{DoxyCompactList}\small\item\em A generic shader base class. \end{DoxyCompactList}\item 
class \hyperlink{a01384}{Uniform\+Pool}
\begin{DoxyCompactList}\small\item\em \hyperlink{a03358}{G\+L\+S\+L} uniform pool. \end{DoxyCompactList}\item 
class \hyperlink{a01435}{Vertex\+Shader}
\begin{DoxyCompactList}\small\item\em \hyperlink{a03358}{G\+L\+S\+L} vertex shader. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a03358_ab0271c685c9d3678ec03e5fe5fd200ca}{typedef std\+::list$<$ std\+::string $>$ {\bfseries String\+List}}\label{a03358_ab0271c685c9d3678ec03e5fe5fd200ca}

\item 
\hypertarget{a03358_a15d034f967d55a97fc4873f7d7579b06}{typedef \hyperlink{a01155}{Shader} $\ast$ {\bfseries Ptr\+Shader}}\label{a03358_a15d034f967d55a97fc4873f7d7579b06}

\item 
\hypertarget{a03358_ad3d59223e0b4cf515fa06b51e47e32c8}{typedef const \hyperlink{a01155}{Shader} $\ast$ {\bfseries Ptr\+Const\+Shader}}\label{a03358_ad3d59223e0b4cf515fa06b51e47e32c8}

\item 
\hypertarget{a03358_aff61e6af4b7bb30ae175d249f36a3c2b}{typedef \hyperlink{a01435}{Vertex\+Shader} $\ast$ {\bfseries Ptr\+Vertex\+Shader}}\label{a03358_aff61e6af4b7bb30ae175d249f36a3c2b}

\item 
\hypertarget{a03358_a77fc5893c8b442b6738513363d374e7d}{typedef const \hyperlink{a01435}{Vertex\+Shader} $\ast$ {\bfseries Ptr\+Vertex\+Const\+Shader}}\label{a03358_a77fc5893c8b442b6738513363d374e7d}

\item 
\hypertarget{a03358_aeb86af9fa024596df33467183a1ee152}{typedef \hyperlink{a00601}{Fragment\+Shader} $\ast$ {\bfseries Ptr\+Fragment\+Shader}}\label{a03358_aeb86af9fa024596df33467183a1ee152}

\item 
\hypertarget{a03358_a6bc2b86d29f3f3cf9f7e71d776f107c1}{typedef const \hyperlink{a00601}{Fragment\+Shader} $\ast$ {\bfseries Ptr\+Const\+Fragment\+Shader}}\label{a03358_a6bc2b86d29f3f3cf9f7e71d776f107c1}

\item 
\hypertarget{a03358_a4d2b7f55c85b29e7f5006e0d36717779}{typedef \hyperlink{a00630}{Geometry\+Shader} $\ast$ {\bfseries Ptr\+Geometry\+Shader}}\label{a03358_a4d2b7f55c85b29e7f5006e0d36717779}

\item 
\hypertarget{a03358_a51e094c52b216895f828d9d9532841ca}{typedef const \hyperlink{a00630}{Geometry\+Shader} $\ast$ {\bfseries Ptr\+Const\+Geometry\+Shader}}\label{a03358_a51e094c52b216895f828d9d9532841ca}

\item 
\hypertarget{a03358_acc9bd428022217abd390cb4f9a481ecd}{typedef \hyperlink{a00448}{Compute\+Shader} $\ast$ {\bfseries Ptr\+Compute\+Shader}}\label{a03358_acc9bd428022217abd390cb4f9a481ecd}

\item 
\hypertarget{a03358_a1b65dc0c981907c4c7b9672e8b75d4a7}{typedef const \hyperlink{a00448}{Compute\+Shader} $\ast$ {\bfseries Ptr\+Const\+Compute\+Shader}}\label{a03358_a1b65dc0c981907c4c7b9672e8b75d4a7}

\item 
\hypertarget{a03358_ae47e3c255455cacb21b69840b0b773e5}{typedef \hyperlink{a01020}{Program} $\ast$ {\bfseries Ptr\+Program}}\label{a03358_ae47e3c255455cacb21b69840b0b773e5}

\item 
\hypertarget{a03358_a2c09ef18ccedbf16ba1da299bff11436}{typedef const \hyperlink{a01020}{Program} $\ast$ {\bfseries Ptr\+Const\+Program}}\label{a03358_a2c09ef18ccedbf16ba1da299bff11436}

\item 
\hypertarget{a03358_a8666aec6213e11a0f51b21fe7085c8bb}{typedef \hyperlink{a01384}{Uniform\+Pool} $\ast$ {\bfseries Ptr\+Uniform\+Pool}}\label{a03358_a8666aec6213e11a0f51b21fe7085c8bb}

\item 
\hypertarget{a03358_a96cb5ab50fd179374c103ca3550c5b10}{typedef const \hyperlink{a01384}{Uniform\+Pool} $\ast$ {\bfseries Ptr\+Const\+Uniform\+Pool}}\label{a03358_a96cb5ab50fd179374c103ca3550c5b10}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{a03358_a25600b64f6d2d498f60fd73feabcfb3f}{load\+Shader\+Rec} (const char $\ast$filename, bool append\+New\+Line\+Char, std\+::map$<$ Q\+String, int $>$ \&include\+Map, G\+L\+S\+L\+::\+String\+List \&shader\+Source)
\begin{DoxyCompactList}\small\item\em Loads the shader source and all recursive includes. \end{DoxyCompactList}\item 
G\+L\+S\+L\+::\+String\+List \hyperlink{a03358_aef2716742dae99d087e88607339223b7}{load\+Shader} (const char $\ast$filename, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool append\+New\+Line\+Char, G\+L\+S\+L\+::\+String\+List $\ast$out\+Includes)
\begin{DoxyCompactList}\small\item\em Loads the shader source. \end{DoxyCompactList}\item 
\hypertarget{a03358_affa742c529a11d203a8f19d409ead6f0}{\hyperlink{a01435}{G\+L\+S\+L\+::\+Ptr\+Vertex\+Shader} \hyperlink{a03358_affa742c529a11d203a8f19d409ead6f0}{load\+Vertex\+Shader} (const char $\ast$name, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)}\label{a03358_affa742c529a11d203a8f19d409ead6f0}

\begin{DoxyCompactList}\small\item\em Loads, compiles and installs a new vertex shader. \end{DoxyCompactList}\item 
\hypertarget{a03358_a2d4a56ad7ab6220e459b95d690f6ff8e}{\hyperlink{a00601}{G\+L\+S\+L\+::\+Ptr\+Fragment\+Shader} \hyperlink{a03358_a2d4a56ad7ab6220e459b95d690f6ff8e}{load\+Fragment\+Shader} (const char $\ast$name, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)}\label{a03358_a2d4a56ad7ab6220e459b95d690f6ff8e}

\begin{DoxyCompactList}\small\item\em Loads, compiles and installs a new vertex shader. \end{DoxyCompactList}\item 
\hypertarget{a03358_a8829a03b4b555262a58e984580bb9c43}{\hyperlink{a00630}{G\+L\+S\+L\+::\+Ptr\+Geometry\+Shader} \hyperlink{a03358_a8829a03b4b555262a58e984580bb9c43}{load\+Geometry\+Shader} (const char $\ast$name, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)}\label{a03358_a8829a03b4b555262a58e984580bb9c43}

\begin{DoxyCompactList}\small\item\em Loads, compiles and installs a new vertex shader. \end{DoxyCompactList}\item 
\hypertarget{a03358_a32f2759e28e7a51dc758428c31fbdf61}{\hyperlink{a01155}{G\+L\+S\+L\+::\+Ptr\+Shader} \hyperlink{a03358_a32f2759e28e7a51dc758428c31fbdf61}{load\+Tess\+Control\+Shader} (const char $\ast$name, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)}\label{a03358_a32f2759e28e7a51dc758428c31fbdf61}

\begin{DoxyCompactList}\small\item\em Loads, compiles and installs a new tessellation control shader. \end{DoxyCompactList}\item 
\hypertarget{a03358_aa03e691829b45dc5e78f203c8cc7d641}{\hyperlink{a01155}{G\+L\+S\+L\+::\+Ptr\+Shader} \hyperlink{a03358_aa03e691829b45dc5e78f203c8cc7d641}{load\+Tess\+Evaluation\+Shader} (const char $\ast$name, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)}\label{a03358_aa03e691829b45dc5e78f203c8cc7d641}

\begin{DoxyCompactList}\small\item\em Loads, compiles and installs a new tessellation evaluation shader. \end{DoxyCompactList}\item 
\hypertarget{a03358_a0545306a0ce6bb3490a208535dafac4b}{\hyperlink{a00448}{G\+L\+S\+L\+::\+Ptr\+Compute\+Shader} \hyperlink{a03358_a0545306a0ce6bb3490a208535dafac4b}{load\+Compute\+Shader} (const char $\ast$name, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)}\label{a03358_a0545306a0ce6bb3490a208535dafac4b}

\begin{DoxyCompactList}\small\item\em Loads, compiles and installs a new compute shader. \end{DoxyCompactList}\item 
\hyperlink{a01020}{G\+L\+S\+L\+::\+Ptr\+Program} \hyperlink{a03358_aadbde846fed270474a7c8a1df7c487c3}{load\+Program} (const char $\ast$vertex\+Shader\+File, const char $\ast$tess\+Control\+Shader\+File, const char $\ast$tess\+Evaluation\+Shader\+File, const char $\ast$geometry\+Shader\+File, const char $\ast$fragment\+Shader\+File, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)
\item 
\hyperlink{a01020}{G\+L\+S\+L\+::\+Ptr\+Program} \hyperlink{a03358_a8713aaa5b40870d5a027169d8d35004b}{load\+Program} (const char $\ast$vertex\+Shader\+File, const char $\ast$geometry\+Shader\+File, const char $\ast$fragment\+Shader\+File, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)
\item 
\hyperlink{a01020}{G\+L\+S\+L\+::\+Ptr\+Program} \hyperlink{a03358_a0f05f686e662363678a8b1f5f6ada41f}{load\+Program} (const char $\ast$vertex\+Shader\+File, const char $\ast$fragment\+Shader\+File, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)
\item 
\hyperlink{a01020}{G\+L\+S\+L\+::\+Ptr\+Program} \hyperlink{a03358_afd4a7fd8c727e94e3da0b3d39af41507}{load\+Compute\+Program} (const char $\ast$compute\+Shader\+File, const G\+L\+S\+L\+::\+String\+List $\ast$macros, bool verbose)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
This namespace contains all the classes and functions for handling \hyperlink{a03358}{G\+L\+S\+L} shader and program objects. 

\subsection{Function Documentation}
\hypertarget{a03358_afd4a7fd8c727e94e3da0b3d39af41507}{\index{G\+L\+S\+L@{G\+L\+S\+L}!load\+Compute\+Program@{load\+Compute\+Program}}
\index{load\+Compute\+Program@{load\+Compute\+Program}!G\+L\+S\+L@{G\+L\+S\+L}}
\subsubsection[{load\+Compute\+Program}]{\setlength{\rightskip}{0pt plus 5cm}{\bf G\+L\+S\+L\+::\+Ptr\+Program} A\+C\+G\+D\+L\+L\+E\+X\+P\+O\+R\+T G\+L\+S\+L\+::load\+Compute\+Program (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{compute\+Shader\+File, }
\item[{const G\+L\+S\+L\+::\+String\+List $\ast$}]{macros = {\ttfamily 0}, }
\item[{bool}]{verbose = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{a03358_afd4a7fd8c727e94e3da0b3d39af41507}
load glsl compute shader and create \hyperlink{a03358}{G\+L\+S\+L} program if successful

\hyperlink{a01155}{Shader} file paths for this function are assumed to be relative to the \char`\"{}\+Shader\char`\"{} directory as specified in Shader\+Prog\+Generator\+::get\+Shader\+Dir() 

Definition at line 1160 of file G\+L\+S\+L\+Shader.\+cc.

\hypertarget{a03358_aadbde846fed270474a7c8a1df7c487c3}{\index{G\+L\+S\+L@{G\+L\+S\+L}!load\+Program@{load\+Program}}
\index{load\+Program@{load\+Program}!G\+L\+S\+L@{G\+L\+S\+L}}
\subsubsection[{load\+Program}]{\setlength{\rightskip}{0pt plus 5cm}{\bf G\+L\+S\+L\+::\+Ptr\+Program} A\+C\+G\+D\+L\+L\+E\+X\+P\+O\+R\+T G\+L\+S\+L\+::load\+Program (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{vertex\+Shader\+File, }
\item[{const char $\ast$}]{tess\+Control\+Shader\+File, }
\item[{const char $\ast$}]{tess\+Evaluation\+Shader\+File, }
\item[{const char $\ast$}]{geometry\+Shader\+File, }
\item[{const char $\ast$}]{fragment\+Shader\+File, }
\item[{const G\+L\+S\+L\+::\+String\+List $\ast$}]{macros = {\ttfamily 0}, }
\item[{bool}]{verbose = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{a03358_aadbde846fed270474a7c8a1df7c487c3}
load shaders and create \hyperlink{a03358}{G\+L\+S\+L} program if successful

\hyperlink{a01155}{Shader} file paths for this function are assumed to be relative to the \char`\"{}\+Shader\char`\"{} directory as specified in Shader\+Prog\+Generator\+::get\+Shader\+Dir() 

Definition at line 1082 of file G\+L\+S\+L\+Shader.\+cc.

\hypertarget{a03358_a8713aaa5b40870d5a027169d8d35004b}{\index{G\+L\+S\+L@{G\+L\+S\+L}!load\+Program@{load\+Program}}
\index{load\+Program@{load\+Program}!G\+L\+S\+L@{G\+L\+S\+L}}
\subsubsection[{load\+Program}]{\setlength{\rightskip}{0pt plus 5cm}{\bf G\+L\+S\+L\+::\+Ptr\+Program} A\+C\+G\+D\+L\+L\+E\+X\+P\+O\+R\+T G\+L\+S\+L\+::load\+Program (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{vertex\+Shader\+File, }
\item[{const char $\ast$}]{geometry\+Shader\+File, }
\item[{const char $\ast$}]{fragment\+Shader\+File, }
\item[{const G\+L\+S\+L\+::\+String\+List $\ast$}]{macros = {\ttfamily 0}, }
\item[{bool}]{verbose = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{a03358_a8713aaa5b40870d5a027169d8d35004b}
load shaders and create \hyperlink{a03358}{G\+L\+S\+L} program if successful

\hyperlink{a01155}{Shader} file paths for this function are assumed to be relative to the \char`\"{}\+Shader\char`\"{} directory as specified in Shader\+Prog\+Generator\+::get\+Shader\+Dir() 

Definition at line 1149 of file G\+L\+S\+L\+Shader.\+cc.

\hypertarget{a03358_a0f05f686e662363678a8b1f5f6ada41f}{\index{G\+L\+S\+L@{G\+L\+S\+L}!load\+Program@{load\+Program}}
\index{load\+Program@{load\+Program}!G\+L\+S\+L@{G\+L\+S\+L}}
\subsubsection[{load\+Program}]{\setlength{\rightskip}{0pt plus 5cm}{\bf G\+L\+S\+L\+::\+Ptr\+Program} A\+C\+G\+D\+L\+L\+E\+X\+P\+O\+R\+T G\+L\+S\+L\+::load\+Program (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{vertex\+Shader\+File, }
\item[{const char $\ast$}]{fragment\+Shader\+File, }
\item[{const G\+L\+S\+L\+::\+String\+List $\ast$}]{macros = {\ttfamily 0}, }
\item[{bool}]{verbose = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{a03358_a0f05f686e662363678a8b1f5f6ada41f}
load shaders and create \hyperlink{a03358}{G\+L\+S\+L} program if successful

\hyperlink{a01155}{Shader} file paths for this function are assumed to be relative to the \char`\"{}\+Shader\char`\"{} directory as specified in Shader\+Prog\+Generator\+::get\+Shader\+Dir() 

Definition at line 1155 of file G\+L\+S\+L\+Shader.\+cc.

\hypertarget{a03358_aef2716742dae99d087e88607339223b7}{\index{G\+L\+S\+L@{G\+L\+S\+L}!load\+Shader@{load\+Shader}}
\index{load\+Shader@{load\+Shader}!G\+L\+S\+L@{G\+L\+S\+L}}
\subsubsection[{load\+Shader}]{\setlength{\rightskip}{0pt plus 5cm}G\+L\+S\+L\+::\+String\+List A\+C\+G\+D\+L\+L\+E\+X\+P\+O\+R\+T G\+L\+S\+L\+::load\+Shader (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename, }
\item[{const G\+L\+S\+L\+::\+String\+List $\ast$}]{macros, }
\item[{bool}]{append\+New\+Line\+Char, }
\item[{G\+L\+S\+L\+::\+String\+List $\ast$}]{out\+Includes}
\end{DoxyParamCaption}
)}}\label{a03358_aef2716742dae99d087e88607339223b7}


Loads the shader source. 

The shader is assumed to be placed in ../shader relative to the executable's installation directory, if the path is a relative one. If it is determined that the path is absolute, the path is taken as is. Macros are inserted directly after the \#version directive. According to glsl spec, only comments and white space are allowed before \#version.


\begin{DoxyParams}{Parameters}
{\em filename} & filename of shader \\
\hline
{\em macros} & \mbox{[}in\mbox{]} preprocessor macros (optional) \\
\hline
{\em append\+New\+Line\+Char} & should each string in the String\+List end on a '~\newline
' \\
\hline
{\em out\+Includes} & \mbox{[}out\mbox{]} additional files that were loaded to resolve \#include directives. \\
\hline
\end{DoxyParams}


Definition at line 927 of file G\+L\+S\+L\+Shader.\+cc.

\hypertarget{a03358_a25600b64f6d2d498f60fd73feabcfb3f}{\index{G\+L\+S\+L@{G\+L\+S\+L}!load\+Shader\+Rec@{load\+Shader\+Rec}}
\index{load\+Shader\+Rec@{load\+Shader\+Rec}!G\+L\+S\+L@{G\+L\+S\+L}}
\subsubsection[{load\+Shader\+Rec}]{\setlength{\rightskip}{0pt plus 5cm}void G\+L\+S\+L\+::load\+Shader\+Rec (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{filename, }
\item[{bool}]{append\+New\+Line\+Char, }
\item[{std\+::map$<$ Q\+String, int $>$ \&}]{include\+Map, }
\item[{G\+L\+S\+L\+::\+String\+List \&}]{shader\+Source}
\end{DoxyParamCaption}
)}}\label{a03358_a25600b64f6d2d498f60fd73feabcfb3f}


Loads the shader source and all recursive includes. 

The shader is assumed to be placed in ../shader relative to the executable's installation directory, if the path is a relativ one. If it is determined that the path is absolute, the path is taken as is. Included files via the \#include directive are recursively resolved. The include-\/map prevents getting stuck in an include loop. 

Definition at line 861 of file G\+L\+S\+L\+Shader.\+cc.

