From 8f13362f7a9f602a7dc7e05c5ec0c2bd32d48deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 28 Nov 2012 16:24:29 +0100 Subject: [PATCH] Allow attribute-less Mesh. For e.g. fullscreen triangle with no vertex data. --- src/Mesh.cpp | 2 +- src/Mesh.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 49956a899..621642dd1 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -111,7 +111,7 @@ void Mesh::bindVAO(GLuint vao) { } void Mesh::bind() { - CORRADE_ASSERT((_vertexCount == 0) == attributes.empty(), "Mesh: vertex count is non-zero, but no attributes are bound", ); + CORRADE_ASSERT((_vertexCount != 0) || !attributes.empty(), "Mesh: attributes are bound but vertex count is zero", ); (this->*bindImplementation)(); } diff --git a/src/Mesh.h b/src/Mesh.h index 369d47a66..a7bcc2286 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -404,8 +404,9 @@ class MAGNUM_EXPORT Mesh { * * Default is zero. * @attention All bound attributes are reset after calling this - * function, so you must call - * addVertexBuffer()/addInterleavedVertexBuffer() afterwards. + * function, so if your mesh has any vertex attributes, be sure + * to call addVertexBuffer()/addInterleavedVertexBuffer() + * afterwards. * @see MeshTools::interleave() */ Mesh* setVertexCount(GLsizei vertexCount);