\hypertarget{classRenderInterface}{}\section{Render\+Interface Class Reference}
\label{classRenderInterface}\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]{classRenderInterface}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
virtual void \hyperlink{classRenderInterface_a0bdffe4bcdecb76f8f899bbd1a5ecc7c}{render} (\hyperlink{classACG_1_1GLState}{A\+C\+G\+::\+G\+L\+State} $\ast$\+\_\+gl\+State, \hyperlink{classViewer_1_1ViewerProperties}{Viewer\+::\+Viewer\+Properties} \&\+\_\+properties)
\begin{DoxyCompactList}\small\item\em rendering function \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classRenderInterface_a9ec209934ac419a61ba95b5bd476e664}\label{classRenderInterface_a9ec209934ac419a61ba95b5bd476e664}} 
virtual \hyperlink{classRenderInterface_a9ec209934ac419a61ba95b5bd476e664}{$\sim$\+Render\+Interface} ()
\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual Q\+Action $\ast$ \hyperlink{classRenderInterface_ade77e083ab999d29a3bec9d2b815aaea}{options\+Action} ()
\begin{DoxyCompactList}\small\item\em Return options menu. \end{DoxyCompactList}\item 
virtual Q\+String \hyperlink{classRenderInterface_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{classRenderInterface_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{classRenderInterface_a5d5f172cbddf1f56376d7034a560a180}{supported\+Draw\+Modes} (\hyperlink{classACG_1_1SceneGraph_1_1DrawModes_1_1DrawMode}{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{classRenderInterface_a1c45ef6a948e3b2c7d34d959e4e13159}{renderer\+Name} ()=0
\begin{DoxyCompactList}\small\item\em announce name for the rendering function \end{DoxyCompactList}\item 
virtual Q\+String \hyperlink{classRenderInterface_ad9ef0d1d1515cc22f5569fae70195987}{check\+Open\+GL} ()=0
\begin{DoxyCompactList}\small\item\em Check Open\+GL 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 60 of file Render\+Interface.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{classRenderInterface_ad9ef0d1d1515cc22f5569fae70195987}\label{classRenderInterface_ad9ef0d1d1515cc22f5569fae70195987}} 
\index{Render\+Interface@{Render\+Interface}!check\+Open\+GL@{check\+Open\+GL}}
\index{check\+Open\+GL@{check\+Open\+GL}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{check\+Open\+GL}{checkOpenGL}}
{\footnotesize\ttfamily virtual Q\+String Render\+Interface\+::check\+Open\+GL (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [pure virtual]}, {\ttfamily [slot]}}



Check Open\+GL capabilities. 

This function has to be implemented and checks, if all required Open\+GL extensions are available. If this is not the case, the plugin will be refused by the core to avoid crashes due to insufficient Open\+GL 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\_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}
\mbox{\Hypertarget{classRenderInterface_ade77e083ab999d29a3bec9d2b815aaea}\label{classRenderInterface_ade77e083ab999d29a3bec9d2b815aaea}} 
\index{Render\+Interface@{Render\+Interface}!options\+Action@{options\+Action}}
\index{options\+Action@{options\+Action}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{options\+Action()}{optionsAction()}}
{\footnotesize\ttfamily virtual Q\+Action$\ast$ Render\+Interface\+::options\+Action (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Return options menu. 

If you want an options \hyperlink{classMenu}{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{classDepthPeeling_a14326cc1d6209f84267d7f9fa657381b}{Depth\+Peeling}, \hyperlink{classToonRenderer_a300acde915a6d0ccc084191daa58caaf}{Toon\+Renderer}, and \hyperlink{classRenderPickingPlugin_a6ef82482413cab4c4825da1489085861}{Render\+Picking\+Plugin}.



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

\mbox{\Hypertarget{classRenderInterface_ad3193e456d0a35f2236285b1dcfb9987}\label{classRenderInterface_ad3193e456d0a35f2236285b1dcfb9987}} 
\index{Render\+Interface@{Render\+Interface}!reload\+Shaders@{reload\+Shaders}}
\index{reload\+Shaders@{reload\+Shaders}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{reload\+Shaders()}{reloadShaders()}}
{\footnotesize\ttfamily virtual void Render\+Interface\+::reload\+Shaders (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



Reload any renderer specific shaders. 

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

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

\mbox{\Hypertarget{classRenderInterface_a0bdffe4bcdecb76f8f899bbd1a5ecc7c}\label{classRenderInterface_a0bdffe4bcdecb76f8f899bbd1a5ecc7c}} 
\index{Render\+Interface@{Render\+Interface}!render@{render}}
\index{render@{render}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{render}{render}}
{\footnotesize\ttfamily virtual void Render\+Interface\+::render (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1GLState}{A\+C\+G\+::\+G\+L\+State} $\ast$}]{\+\_\+gl\+State,  }\item[{\hyperlink{classViewer_1_1ViewerProperties}{Viewer\+::\+Viewer\+Properties} \&}]{\+\_\+properties }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}, {\ttfamily [slot]}}



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 129 of file Render\+Interface.\+hh.

\mbox{\Hypertarget{classRenderInterface_a1c45ef6a948e3b2c7d34d959e4e13159}\label{classRenderInterface_a1c45ef6a948e3b2c7d34d959e4e13159}} 
\index{Render\+Interface@{Render\+Interface}!renderer\+Name@{renderer\+Name}}
\index{renderer\+Name@{renderer\+Name}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{renderer\+Name}{rendererName}}
{\footnotesize\ttfamily virtual Q\+String Render\+Interface\+::renderer\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [pure virtual]}, {\ttfamily [slot]}}



announce name for the rendering function 

\begin{DoxyReturn}{Returns}
Name displayed for the rendering function 
\end{DoxyReturn}
\mbox{\Hypertarget{classRenderInterface_aeb8df2a3aeee771a5e3a3616796d9cab}\label{classRenderInterface_aeb8df2a3aeee771a5e3a3616796d9cab}} 
\index{Render\+Interface@{Render\+Interface}!render\+Objects\+Info@{render\+Objects\+Info}}
\index{render\+Objects\+Info@{render\+Objects\+Info}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{render\+Objects\+Info()}{renderObjectsInfo()}}
{\footnotesize\ttfamily virtual Q\+String Render\+Interface\+::render\+Objects\+Info (\begin{DoxyParamCaption}\item[{bool}]{\+\_\+output\+Shader\+Info }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [virtual]}}



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{classDepthPeeling_ac578238f4ba0551f111bbed9c58e588b}{Depth\+Peeling}, \hyperlink{classRenderer_a3b1dc367be3092984a5df21ddf6e9228}{Renderer}, \hyperlink{classToonRenderer_a264a9655b7ae7280784eeb166ab49758}{Toon\+Renderer}, and \hyperlink{classNormalRenderer_acb182341acf372bbfa74eeec72823650}{Normal\+Renderer}.



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

\mbox{\Hypertarget{classRenderInterface_a5d5f172cbddf1f56376d7034a560a180}\label{classRenderInterface_a5d5f172cbddf1f56376d7034a560a180}} 
\index{Render\+Interface@{Render\+Interface}!supported\+Draw\+Modes@{supported\+Draw\+Modes}}
\index{supported\+Draw\+Modes@{supported\+Draw\+Modes}!Render\+Interface@{Render\+Interface}}
\subsubsection{\texorpdfstring{supported\+Draw\+Modes}{supportedDrawModes}}
{\footnotesize\ttfamily virtual void Render\+Interface\+::supported\+Draw\+Modes (\begin{DoxyParamCaption}\item[{\hyperlink{classACG_1_1SceneGraph_1_1DrawModes_1_1DrawMode}{A\+C\+G\+::\+Scene\+Graph\+::\+Draw\+Modes\+::\+Draw\+Mode} \&}]{\+\_\+mode }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}, {\ttfamily [pure virtual]}, {\ttfamily [slot]}}



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{RenderInterface_8hh}{Render\+Interface.\+hh}\end{DoxyCompactItemize}
