\hypertarget{a01107}{\section{Render\+Interface Class Reference}
\label{a01107}\index{Render\+Interface@{Render\+Interface}}
}


Interface to add additional rendering functions from within plugins.  




{\ttfamily \#include $<$Open\+Flipper/\+Base\+Plugin/\+Render\+Interface.\+hh$>$}

Inheritance diagram for Render\+Interface\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=9.000000cm]{a01107}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a01107_a0bdffe4bcdecb76f8f899bbd1a5ecc7c}{render} (\hyperlink{a00643}{A\+C\+G\+::\+G\+L\+State} $\ast$\+\_\+gl\+State, \hyperlink{a01451}{Viewer\+::\+Viewer\+Properties} \&\+\_\+properties)
\begin{DoxyCompactList}\small\item\em rendering function \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{a01107_a9ec209934ac419a61ba95b5bd476e664}{virtual \hyperlink{a01107_a9ec209934ac419a61ba95b5bd476e664}{$\sim$\+Render\+Interface} ()}\label{a01107_a9ec209934ac419a61ba95b5bd476e664}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual Q\+Action $\ast$ \hyperlink{a01107_ade77e083ab999d29a3bec9d2b815aaea}{options\+Action} ()
\begin{DoxyCompactList}\small\item\em Return options menu. \end{DoxyCompactList}\item 
virtual Q\+String \hyperlink{a01107_aeb8df2a3aeee771a5e3a3616796d9cab}{render\+Objects\+Info} (bool \+\_\+output\+Shader\+Info)
\begin{DoxyCompactList}\small\item\em Return a qstring of the current render objects. \end{DoxyCompactList}\item 
virtual void \hyperlink{a01107_ad3193e456d0a35f2236285b1dcfb9987}{reload\+Shaders} ()
\begin{DoxyCompactList}\small\item\em Reload any renderer specific shaders. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Slots}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{a01107_a5d5f172cbddf1f56376d7034a560a180}{supported\+Draw\+Modes} (\hyperlink{a00509}{A\+C\+G\+::\+Scene\+Graph\+::\+Draw\+Modes\+::\+Draw\+Mode} \&\+\_\+mode)=0
\begin{DoxyCompactList}\small\item\em announce required draw modes \end{DoxyCompactList}\item 
virtual Q\+String \hyperlink{a01107_a1c45ef6a948e3b2c7d34d959e4e13159}{renderer\+Name} ()=0
\begin{DoxyCompactList}\small\item\em announce name for the rendering function \end{DoxyCompactList}\item 
virtual Q\+String \hyperlink{a01107_ad9ef0d1d1515cc22f5569fae70195987}{check\+Open\+G\+L} ()=0
\begin{DoxyCompactList}\small\item\em Check Open\+G\+L capabilities. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Interface to add additional rendering functions from within plugins. 

\hyperlink{renderInterfacePage}{Detailed description} ~\newline
~\newline
 Interface for adding and controlling rendering functions from a plugin.~\newline


Definition at line 70 of file Render\+Interface.\+hh.



\subsection{Member Function Documentation}
\hypertarget{a01107_ad9ef0d1d1515cc22f5569fae70195987}{\index{Render\+Interface@{Render\+Interface}!check\+Open\+G\+L@{check\+Open\+G\+L}}
\index{check\+Open\+G\+L@{check\+Open\+G\+L}!Render\+Interface@{Render\+Interface}}
\subsubsection[{check\+Open\+G\+L}]{\setlength{\rightskip}{0pt plus 5cm}virtual Q\+String Render\+Interface\+::check\+Open\+G\+L (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [pure virtual]}, {\ttfamily [slot]}}}\label{a01107_ad9ef0d1d1515cc22f5569fae70195987}


Check Open\+G\+L capabilities. 

This function has to be implemented and checks, if all required Open\+G\+L extensions are available. If this is not the case, the plugin will be refused by the core to avoid crashes due to insufficient Open\+G\+L support.

You can get the version information in the following way\+:


\begin{DoxyCode}
\textcolor{comment}{// Get version and check}
QGLFormat::OpenGLVersionFlags flags = QGLFormat::openGLVersionFlags();
\textcolor{keywordflow}{if} ( ! flags.testFlag(QGLFormat::OpenGL\_Version\_2\_1) )
  \textcolor{keywordflow}{return} QString(\textcolor{stringliteral}{"Insufficient OpenGL Version! OpenGL 2.1 or higher required"});

\textcolor{comment}{//Get OpenGL extensions}
QString glExtensions = QString((\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)glGetString(GL\_EXTENSIONS));

\textcolor{comment}{// Collect missing extension}
QString missing = \textcolor{stringliteral}{""};

\textcolor{keywordflow}{if} ( !glExtensions.contains(\textcolor{stringliteral}{"GL\_ARB\_vertex\_buffer\_object"}) )
  missing += \textcolor{stringliteral}{"Missing Extension GL\_ARB\_vertex\_buffer\_object\(\backslash\)n"};

\textcolor{keywordflow}{if} ( !glExtensions.contains(\textcolor{stringliteral}{"GL\_ARB\_vertex\_program"}) )
  missing += \textcolor{stringliteral}{"Missing Extension GL\_ARB\_vertex\_program\(\backslash\)n"};

\textcolor{keywordflow}{return} missing;
\end{DoxyCode}


\begin{DoxyReturn}{Returns}
Return an empty string if everything is fine, otherwise return, what features are missing. 
\end{DoxyReturn}
\hypertarget{a01107_ade77e083ab999d29a3bec9d2b815aaea}{\index{Render\+Interface@{Render\+Interface}!options\+Action@{options\+Action}}
\index{options\+Action@{options\+Action}!Render\+Interface@{Render\+Interface}}
\subsubsection[{options\+Action}]{\setlength{\rightskip}{0pt plus 5cm}virtual Q\+Action$\ast$ Render\+Interface\+::options\+Action (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01107_ade77e083ab999d29a3bec9d2b815aaea}


Return options menu. 

If you want an options \hyperlink{a00802}{Menu} or menu entry, you can return your action here. It will be shown on top of the renderer list in the options menu.

\begin{DoxyReturn}{Returns}
Action for a menu or menu entry 
\end{DoxyReturn}


Reimplemented in \hyperlink{a00495_a14326cc1d6209f84267d7f9fa657381b}{Depth\+Peeling}, \hyperlink{a01312_a300acde915a6d0ccc084191daa58caaf}{Toon\+Renderer}, and \hyperlink{a01114_a6ef82482413cab4c4825da1489085861}{Render\+Picking\+Plugin}.



Definition at line 152 of file Render\+Interface.\+hh.

\hypertarget{a01107_ad3193e456d0a35f2236285b1dcfb9987}{\index{Render\+Interface@{Render\+Interface}!reload\+Shaders@{reload\+Shaders}}
\index{reload\+Shaders@{reload\+Shaders}!Render\+Interface@{Render\+Interface}}
\subsubsection[{reload\+Shaders}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Render\+Interface\+::reload\+Shaders (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01107_ad3193e456d0a35f2236285b1dcfb9987}


Reload any renderer specific shaders. 

This function allows the plugin to reload any renderer specific shaders. 

Definition at line 172 of file Render\+Interface.\+hh.

\hypertarget{a01107_a0bdffe4bcdecb76f8f899bbd1a5ecc7c}{\index{Render\+Interface@{Render\+Interface}!render@{render}}
\index{render@{render}!Render\+Interface@{Render\+Interface}}
\subsubsection[{render}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Render\+Interface\+::render (
\begin{DoxyParamCaption}
\item[{{\bf A\+C\+G\+::\+G\+L\+State} $\ast$}]{\+\_\+gl\+State, }
\item[{{\bf Viewer\+::\+Viewer\+Properties} \&}]{\+\_\+properties}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}, {\ttfamily [slot]}}}\label{a01107_a0bdffe4bcdecb76f8f899bbd1a5ecc7c}


rendering function 

Implement this function to render the scene. You have to traverse the scenegraph in this function. The gl\+Context is made current before this call. If you need to initialize something,you can do it within this function. gl and glew are already set\+Up here. 

Definition at line 142 of file Render\+Interface.\+hh.

\hypertarget{a01107_a1c45ef6a948e3b2c7d34d959e4e13159}{\index{Render\+Interface@{Render\+Interface}!renderer\+Name@{renderer\+Name}}
\index{renderer\+Name@{renderer\+Name}!Render\+Interface@{Render\+Interface}}
\subsubsection[{renderer\+Name}]{\setlength{\rightskip}{0pt plus 5cm}virtual Q\+String Render\+Interface\+::renderer\+Name (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [pure virtual]}, {\ttfamily [slot]}}}\label{a01107_a1c45ef6a948e3b2c7d34d959e4e13159}


announce name for the rendering function 

\begin{DoxyReturn}{Returns}
Name displayed for the rendering function 
\end{DoxyReturn}
\hypertarget{a01107_aeb8df2a3aeee771a5e3a3616796d9cab}{\index{Render\+Interface@{Render\+Interface}!render\+Objects\+Info@{render\+Objects\+Info}}
\index{render\+Objects\+Info@{render\+Objects\+Info}!Render\+Interface@{Render\+Interface}}
\subsubsection[{render\+Objects\+Info}]{\setlength{\rightskip}{0pt plus 5cm}virtual Q\+String Render\+Interface\+::render\+Objects\+Info (
\begin{DoxyParamCaption}
\item[{bool}]{\+\_\+output\+Shader\+Info}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}}\label{a01107_aeb8df2a3aeee771a5e3a3616796d9cab}


Return a qstring of the current render objects. 

In this function your plugin should return a list of the render objects (possibly with additional information). It can be used for debugging purposes.

The I\+Renderer class already has a function called dump\+Current\+Render\+Objects\+To\+String() which can be used to implement this function.


\begin{DoxyParams}{Parameters}
{\em \+\_\+output\+Shader\+Info} & Output shader code along with the render objects \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
string of render objects 
\end{DoxyReturn}


Reimplemented in \hyperlink{a00495_ac578238f4ba0551f111bbed9c58e588b}{Depth\+Peeling}, \hyperlink{a01103_a3b1dc367be3092984a5df21ddf6e9228}{Renderer}, \hyperlink{a01312_a264a9655b7ae7280784eeb166ab49758}{Toon\+Renderer}, and \hyperlink{a00888_acb182341acf372bbfa74eeec72823650}{Normal\+Renderer}.



Definition at line 165 of file Render\+Interface.\+hh.

\hypertarget{a01107_a5d5f172cbddf1f56376d7034a560a180}{\index{Render\+Interface@{Render\+Interface}!supported\+Draw\+Modes@{supported\+Draw\+Modes}}
\index{supported\+Draw\+Modes@{supported\+Draw\+Modes}!Render\+Interface@{Render\+Interface}}
\subsubsection[{supported\+Draw\+Modes}]{\setlength{\rightskip}{0pt plus 5cm}virtual void Render\+Interface\+::supported\+Draw\+Modes (
\begin{DoxyParamCaption}
\item[{{\bf A\+C\+G\+::\+Scene\+Graph\+::\+Draw\+Modes\+::\+Draw\+Mode} \&}]{\+\_\+mode}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [pure virtual]}, {\ttfamily [slot]}}}\label{a01107_a5d5f172cbddf1f56376d7034a560a180}


announce required draw modes 

This function is called by the core to get a list of draw modes that are supported by this renderer. If such a draw mode is set and the currently active renderer does not support the given mode, the core will switch to this renderer automatically. If there are multiple renderers capable of rendering the drawmode(s), the core will ask the user for its preference.


\begin{DoxyParams}{Parameters}
{\em \+\_\+mode} & Combined list of drawmodes \\
\hline
\end{DoxyParams}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/\+Base\+Plugin/\hyperlink{a02460}{Render\+Interface.\+hh}\end{DoxyCompactItemize}
