diff --git a/src/framework/mesh.cpp b/src/framework/mesh.cpp index 07baba2..bcbb35b 100644 --- a/src/framework/mesh.cpp +++ b/src/framework/mesh.cpp @@ -17,6 +17,9 @@ using namespace glm; void Mesh::load(const std::vector& vertices, const std::vector& indices) { // Load data into buffers numIndices = indices.size(); +#ifndef MODERN_GL + vao.bind(); +#endif vbo.load(vertices, GL_STATIC_DRAW); ebo.load(indices, GL_STATIC_DRAW); @@ -30,7 +33,6 @@ void Mesh::load(const std::vector& vertices, const std::vector& vertices, const std::vector& vertices, const std::vector& attributeSizes, const std::vector& indices) { // Load data into buffers numIndices = indices.size(); +#ifndef MODERN_GL + vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers +#endif vbo.load(vertices, GL_STATIC_DRAW); ebo.load(indices, GL_STATIC_DRAW); @@ -62,7 +67,6 @@ void Mesh::load(const std::vector& vertices, const std::vector& vertices, const std::vector& vertices, const std::vector& indices) { // Load data into buffers numIndices = indices.size(); +#ifndef MODERN_GL + vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers +#endif vbo.load(vertices, GL_STATIC_DRAW); ebo.load(indices, GL_STATIC_DRAW); @@ -94,7 +101,6 @@ void Mesh::load(const std::vector& vertices, const std::vector& vertices, const std::vector& vertices, const std::vector& indices) { // Load data into buffers numIndices = indices.size(); +#ifndef MODERN_GL + vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers +#endif vbo.load(vertices, GL_STATIC_DRAW); ebo.load(indices, GL_STATIC_DRAW); @@ -129,7 +138,6 @@ void Mesh::load(const std::vector& vertices, const std::vector& vertices, const std::vector& vertices, const std::vector& indices) { // Load data into buffers numIndices = indices.size(); +#ifndef MODERN_GL + vao.bind(); // NOTE: Bind VAO first as Core Profile requires a VAO to be bound when loading buffers +#endif vbo.load(vertices, GL_STATIC_DRAW); ebo.load(indices, GL_STATIC_DRAW); @@ -170,7 +181,6 @@ void Mesh::load(const std::vector& vertices, const std::vector