You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
594 B
25 lines
594 B
#include "FullScreenQuad.h"
|
|
|
|
|
|
void FullScreenQuad::Init()
|
|
{
|
|
float pos[] = {
|
|
-0.5f,-0.5f,-1.0f,
|
|
0.5f,-0.5f,-1.0f,
|
|
0.5f,0.5f,-1.0f,
|
|
-0.5f,0.5f,-1.0f
|
|
};
|
|
glGenBuffers(1, &mVBO);
|
|
glBindBuffer(GL_ARRAY_BUFFER, mVBO);
|
|
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 12, pos, GL_STATIC_DRAW);
|
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
|
}
|
|
|
|
void FullScreenQuad::Draw(GLint posLoc)
|
|
{
|
|
glBindBuffer(GL_ARRAY_BUFFER, mVBO);
|
|
glEnableVertexAttribArray(posLoc);
|
|
glVertexAttribPointer(posLoc, 3, GL_FLOAT, GL_FALSE, sizeof(float) * 3, 0);
|
|
glDrawArrays(GL_QUADS, 0, 4);
|
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
|
}
|