Make VertexAttributePointer store index instead of buffer pointer
This commit is contained in:
@@ -25,7 +25,11 @@ struct VertexAttribute {
|
||||
VertexAttributeLayout layout;
|
||||
};
|
||||
|
||||
struct VertexAttributePointer;
|
||||
struct VertexAttributePointer {
|
||||
VertexAttribute attribute;
|
||||
GLuint buffer;
|
||||
GLuint index;
|
||||
};
|
||||
|
||||
static bool isIndexInVertexAttribute(int i, const VertexAttribute& va) {
|
||||
if ((i -= va.layout.offset) < 0) { return false; }
|
||||
@@ -85,12 +89,6 @@ class VertexBuffer<true>
|
||||
|
||||
};
|
||||
|
||||
struct VertexAttributePointer {
|
||||
VertexAttribute attribute;
|
||||
VertexBuffer<false>* buffer;
|
||||
GLuint index;
|
||||
};
|
||||
|
||||
class VAO : public OpenGLObject {
|
||||
using Base = OpenGLObject;
|
||||
using Codes = VAOError::Codes;
|
||||
|
||||
Reference in New Issue
Block a user