DeferredRenderer 1.0
|
A screenquad for drawing textures onto quads for projection. More...
#include <ScreenQuad.h>
Public Member Functions | |
ScreenQuad () | |
ctor | |
ScreenQuad (const float &_x, const float &_y, const float &_extent, const float &_depth) | |
construct our screen quad with screen pos and extent | |
~ScreenQuad () | |
dtor | |
void | genVAO () |
void | draw (const std::string &_shaderName, unsigned int &_vao) |
draw the quad | |
Private Attributes | |
float | m_x |
quad screen x value | |
float | m_y |
quad screen y value | |
float | m_extent |
quads size | |
float | m_depth |
quad screen z value |
A screenquad for drawing textures onto quads for projection.
Definition at line 14 of file ScreenQuad.h.
ScreenQuad::ScreenQuad | ( | ) |
ScreenQuad::ScreenQuad | ( | const float & | _x, |
const float & | _y, | ||
const float & | _extent, | ||
const float & | _depth | ||
) |
ScreenQuad::~ScreenQuad | ( | ) |
void ScreenQuad::draw | ( | const std::string & | _shaderName, |
unsigned int & | _vao | ||
) |
draw the quad
[in] | _shaderName | our screenquad shader |
[in] | _our | screenquad vao id |
Definition at line 21 of file ScreenQuad.cpp.
References m_depth, m_extent, m_x, and m_y.
{ ngl::ShaderManager *shader = ngl::ShaderManager::instance(); (*shader)[_shaderName]->use(); shader->setShaderParam4f(_shaderName, "u_CentreDepthExtent", m_x, m_y, m_depth, m_extent); // now we bind back our vertex array object and draw glBindVertexArray(_vao); // select first VAO glDrawArrays(GL_QUADS, 0, 4); // draw first object // go back to default just incase glEnableVertexAttribArray(0); glBindVertexArray(0); }
void ScreenQuad::genVAO | ( | ) |
float ScreenQuad::m_depth [private] |
quad screen z value
Definition at line 44 of file ScreenQuad.h.
float ScreenQuad::m_extent [private] |
quads size
Definition at line 42 of file ScreenQuad.h.
float ScreenQuad::m_x [private] |
quad screen x value
Definition at line 38 of file ScreenQuad.h.
float ScreenQuad::m_y [private] |
quad screen y value
Definition at line 40 of file ScreenQuad.h.