mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
vao
This commit is contained in:
24
gl/vao.cpp
Normal file
24
gl/vao.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user