16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 15:09:19 +02:00

create generic gl::buffer, rebase gl::ubo onto it

This commit is contained in:
milek7
2018-10-21 00:16:02 +02:00
parent e3cfa2acbe
commit 7c9c19908a
5 changed files with 117 additions and 23 deletions

View File

@@ -2,24 +2,20 @@
#include "object.h"
#include "bindable.h"
#include "buffer.h"
#define UBS_PAD(x) uint8_t PAD[x]
namespace gl
{
static GLuint next_binding_point;
class ubo : public object, public bindable<ubo>
class ubo : public buffer
{
int index;
public:
ubo(int size, int index, GLenum hint = GL_DYNAMIC_DRAW);
~ubo();
void bind_uniform();
using bindable::bind;
static void bind(GLuint i);
void update(const uint8_t *data, int offset, int size);
template <typename T> void update(const T &data, size_t offset = 0)