summaryrefslogtreecommitdiff
path: root/gfx/gl
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/vertexArrayObject.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gfx/gl/vertexArrayObject.h b/gfx/gl/vertexArrayObject.h
index 57daaf3..d008897 100644
--- a/gfx/gl/vertexArrayObject.h
+++ b/gfx/gl/vertexArrayObject.h
@@ -21,14 +21,15 @@ public:
NO_COPY(VertexArrayObject);
template<typename m, typename T> struct MP {
- constexpr MP(m T::*p) : P {p} { }
+ constexpr MP(m T::* p) : P {p} { }
+ constexpr
operator void *() const
{
return &(static_cast<T *>(nullptr)->*P);
}
- m T::*P;
+ m T::* P;
using value_type = m;
};
@@ -69,6 +70,13 @@ public:
return *this;
}
+ VertexArrayObject &
+ data(const GLuint arrayBuffer, GLenum target)
+ {
+ glBindBuffer(target, arrayBuffer);
+ return *this;
+ }
+
template<typename Data>
static void
data(const Data & data, const GLuint arrayBuffer, GLenum target)