\hypertarget{a07544}{}\section{A\+CG\+:\+:Screen\+Quad Class Reference}
\label{a07544}\index{A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}}


{\ttfamily \#include $<$Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+G\+L/\+Screen\+Quad.\+hh$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a07544_af74ba7fd111b15d3544346dd9a0b7371}\label{a07544_af74ba7fd111b15d3544346dd9a0b7371}} 
\hyperlink{a07544_af74ba7fd111b15d3544346dd9a0b7371}{$\sim$\+Screen\+Quad} ()
\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void \hyperlink{a07544_a2deea2d329efedb39a3972721564bf20}{draw} (\hyperlink{a08132}{G\+L\+S\+L\+::\+Program} $\ast$\+\_\+prog=0)
\begin{DoxyCompactList}\small\item\em Draw the screen quad. \end{DoxyCompactList}\item 
static void \hyperlink{a07544_a2db7429eb8ff86c6598d0b6a477c3081}{draw\+Instanced} (int \+\_\+count, \hyperlink{a08132}{G\+L\+S\+L\+::\+Program} $\ast$\+\_\+prog=0)
\begin{DoxyCompactList}\small\item\em Draw the screen quad with instancing. \end{DoxyCompactList}\item 
static void \hyperlink{a07544_ab663135be43264406f907f49a976855d}{draw\+Texture2D} (G\+Luint \+\_\+texture, const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&\+\_\+offset=\hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f}(0.\+0f, 0.\+0f), const Vec2f \&\+\_\+size=\+Vec2f(1.\+0f, 1.\+0f))
\begin{DoxyCompactList}\small\item\em Draw a 2D texture to screen. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a07544_ab9752580e12d9c92801956bf84018694}\label{a07544_ab9752580e12d9c92801956bf84018694}} 
\hyperlink{a07544_ab9752580e12d9c92801956bf84018694}{Screen\+Quad} ()
\begin{DoxyCompactList}\small\item\em Default constructor. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a07544_a31457b307417364245f65a8caa71dc1f}\label{a07544_a31457b307417364245f65a8caa71dc1f}} 
void \hyperlink{a07544_a31457b307417364245f65a8caa71dc1f}{init} ()
\begin{DoxyCompactList}\small\item\em Initialize vbo and format. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a07544_a0c5b541aaf5f0bed3768461c14b8af98}\label{a07544_a0c5b541aaf5f0bed3768461c14b8af98}} 
void \hyperlink{a07544_a0c5b541aaf5f0bed3768461c14b8af98}{int\+Draw} (\hyperlink{a08132}{G\+L\+S\+L\+::\+Program} $\ast$\+\_\+prog, int \+\_\+num\+Instances=0)
\begin{DoxyCompactList}\small\item\em Internal draw function. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a07544_a19936d6c575f2d08ff6f33e2cdf7ef4b}\label{a07544_a19936d6c575f2d08ff6f33e2cdf7ef4b}} 
static \hyperlink{a07544}{Screen\+Quad} \& \hyperlink{a07544_a19936d6c575f2d08ff6f33e2cdf7ef4b}{instance} ()
\begin{DoxyCompactList}\small\item\em Get singleton instance. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{a07544_ae27b9195c5f3157b54ecd17a3704be7b}\label{a07544_ae27b9195c5f3157b54ecd17a3704be7b}} 
G\+Luint \hyperlink{a07544_ae27b9195c5f3157b54ecd17a3704be7b}{vbo\+\_\+}
\begin{DoxyCompactList}\small\item\em vbo containing the quad in projected coordinates \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a07544_a74998334aeb0fcaf091ac67fd52f6bf1}\label{a07544_a74998334aeb0fcaf091ac67fd52f6bf1}} 
\hyperlink{a07596}{Vertex\+Declaration} $\ast$ \hyperlink{a07544_a74998334aeb0fcaf091ac67fd52f6bf1}{decl\+\_\+}
\begin{DoxyCompactList}\small\item\em vertex format of screen quad (float2 pos) \end{DoxyCompactList}\item 
\mbox{\Hypertarget{a07544_a91b333b48488dace025fc5b2668263f9}\label{a07544_a91b333b48488dace025fc5b2668263f9}} 
\hyperlink{a08132}{G\+L\+S\+L\+::\+Program} $\ast$ \hyperlink{a07544_a91b333b48488dace025fc5b2668263f9}{tex\+Draw\+Prog\+\_\+}
\begin{DoxyCompactList}\small\item\em Simple texture drawing shader. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
This class provides a simple method to draw a screen-\/aligned quad. 

Definition at line 72 of file Screen\+Quad.\+hh.



\subsection{Member Function Documentation}
\mbox{\Hypertarget{a07544_a2deea2d329efedb39a3972721564bf20}\label{a07544_a2deea2d329efedb39a3972721564bf20}} 
\index{A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}!draw@{draw}}
\index{draw@{draw}!A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}}
\subsubsection{\texorpdfstring{draw()}{draw()}}
{\footnotesize\ttfamily void A\+C\+G\+::\+Screen\+Quad\+::draw (\begin{DoxyParamCaption}\item[{\hyperlink{a08132}{G\+L\+S\+L\+::\+Program} $\ast$}]{\+\_\+prog = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Draw the screen quad. 

The quad is in projected space with coordinates in \mbox{[}-\/1, 1\mbox{]}. 
\begin{DoxyParams}{Parameters}
{\em \+\_\+prog} & \hyperlink{a06188}{G\+L\+SL} shader to bind attribute id\textquotesingle{}s if needed. Pass null-\/pointer for fixed function rendering \\
\hline
\end{DoxyParams}


Definition at line 138 of file Screen\+Quad.\+cc.

\mbox{\Hypertarget{a07544_a2db7429eb8ff86c6598d0b6a477c3081}\label{a07544_a2db7429eb8ff86c6598d0b6a477c3081}} 
\index{A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}!draw\+Instanced@{draw\+Instanced}}
\index{draw\+Instanced@{draw\+Instanced}!A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}}
\subsubsection{\texorpdfstring{draw\+Instanced()}{drawInstanced()}}
{\footnotesize\ttfamily void A\+C\+G\+::\+Screen\+Quad\+::draw\+Instanced (\begin{DoxyParamCaption}\item[{int}]{\+\_\+count,  }\item[{\hyperlink{a08132}{G\+L\+S\+L\+::\+Program} $\ast$}]{\+\_\+prog = {\ttfamily 0} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Draw the screen quad with instancing. 

Can be used for render to 2\+D-\/array / 3D volume The quad is in projected space with coordinates in \mbox{[}-\/1, 1\mbox{]}. 
\begin{DoxyParams}{Parameters}
{\em \+\_\+count} & number of instances \\
\hline
{\em \+\_\+prog} & \hyperlink{a06188}{G\+L\+SL} shader to bind attribute id\textquotesingle{}s if needed. Pass null-\/pointer for fixed function rendering \\
\hline
\end{DoxyParams}


Definition at line 150 of file Screen\+Quad.\+cc.

\mbox{\Hypertarget{a07544_ab663135be43264406f907f49a976855d}\label{a07544_ab663135be43264406f907f49a976855d}} 
\index{A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}!draw\+Texture2D@{draw\+Texture2D}}
\index{draw\+Texture2D@{draw\+Texture2D}!A\+C\+G\+::\+Screen\+Quad@{A\+C\+G\+::\+Screen\+Quad}}
\subsubsection{\texorpdfstring{draw\+Texture2\+D()}{drawTexture2D()}}
{\footnotesize\ttfamily void A\+C\+G\+::\+Screen\+Quad\+::draw\+Texture2D (\begin{DoxyParamCaption}\item[{G\+Luint}]{\+\_\+texture,  }\item[{const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&}]{\+\_\+offset = {\ttfamily \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f}(0.0f,~0.0f)},  }\item[{const \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f} \&}]{\+\_\+size = {\ttfamily \hyperlink{a06176_a8b858737aebd55e312149cf208a0b3f3}{Vec2f}(1.0f,~1.0f)} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Draw a 2D texture to screen. 

Useful for debugging, copying a texture..


\begin{DoxyParams}{Parameters}
{\em \+\_\+texture} & \hyperlink{a07344}{Texture} that should be bound when drawing the quad \\
\hline
{\em \+\_\+offset} & Offset passed to the uniform called offset in the shader \\
\hline
{\em \+\_\+size} & Size passed to the uniform called size in the shader \\
\hline
\end{DoxyParams}


Definition at line 197 of file Screen\+Quad.\+cc.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+G\+L/Screen\+Quad.\+hh\item 
Open\+Flipper/libs\+\_\+required/\+A\+C\+G/\+G\+L/Screen\+Quad.\+cc\end{DoxyCompactItemize}
