This commit is contained in:
milek7
2018-06-25 01:15:37 +02:00
parent 0c5f990528
commit 694aac6065
13 changed files with 131 additions and 114 deletions

24
gl/vao.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include "stdafx.h"
#include "vao.h"
gl::vao::vao()
{
glGenVertexArrays(1, *this);
}
gl::vao::~vao()
{
glDeleteVertexArrays(1, *this);
}
void gl::vao::setup_attrib(int attrib, int size, int type, int stride, int offset)
{
bind();
glVertexAttribPointer(attrib, size, type, GL_FALSE, stride, reinterpret_cast<void*>(offset));
glEnableVertexAttribArray(attrib);
}
void gl::vao::bind(GLuint i)
{
glBindVertexArray(i);
}