Files
maszyna/gl/vao.h
2019-03-12 00:53:34 +01:00

38 lines
694 B
C++

#pragma once
#include "object.h"
#include "bindable.h"
#include "buffer.h"
namespace gl
{
class vao : public bindable<vao>
{
struct attrib_params {
// TBD: should be shared_ptr? (when buffer is destroyed by owner VAO could still potentially exist)
gl::buffer &buffer;
int attrib;
int size;
int type;
int stride;
int offset;
};
buffer *ebo = nullptr;
std::vector<attrib_params> params;
public:
//vao();
//~vao();
void setup_attrib(buffer &buffer, int attrib, int size, int type, int stride, int offset);
void setup_ebo(buffer &ebo);
//using bindable::bind;
void bind();
static void unbind();
//static void bind(GLuint i);
};
}