From 9ea3a3610511d6d17656a0ee04ac1640d00aee9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 26 Feb 2012 15:18:51 +0100 Subject: [PATCH] Added function Mesh::isInterleaved(). --- src/Mesh.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Mesh.h b/src/Mesh.h index 14abf26b9..e97e0e7b4 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -142,10 +142,24 @@ class MAGNUM_EXPORT Mesh { * every vertex will be in one continuous place. * * Adds new buffer to the mesh. The buffer can be then filled with - * Buffer::setData(). + * Buffer::setData(). See also isInterleaved(). + * + * @todo Move interleaveability to Buffer itself? */ Buffer* addBuffer(bool interleaved); + /** + * @brief Whether given buffer is interleaved + * @return True if the buffer belongs to the mesh and the buffer is + * interleaved, false otherwise. + * + * See also addBuffer(). + */ + inline bool isInterleaved(Buffer* buffer) const { + auto found = _buffers.find(buffer); + return found != _buffers.end() && found->second.first; + } + /** * @brief Bind attribute * @param buffer Buffer where bind the attribute to (pointer