Files
maszyna/gl/vao.cpp
milek7 694aac6065 vao
2018-06-25 11:43:03 +02:00

25 lines
444 B
C++

#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);
}