From 8099511d12e5ceb30161e242d91f8c242a389722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 7 Dec 2011 20:26:00 +0100 Subject: [PATCH] Added implicit constructors for Mesh and IndexedMesh. --- src/IndexedMesh.h | 10 ++++++++++ src/Mesh.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/IndexedMesh.h b/src/IndexedMesh.h index 38131d987..f235e9d9e 100644 --- a/src/IndexedMesh.h +++ b/src/IndexedMesh.h @@ -29,6 +29,16 @@ namespace Magnum { */ class IndexedMesh: public Mesh { public: + /** + * @brief Implicit constructor + * + * Allows creating the object without knowing anything about mesh data. + * Note that you have to call setPrimitive(), setVertexCount(), + * setIndexCount() and setIndexType() manually for mesh to draw + * properly. + */ + inline IndexedMesh(): _indexBuffer(Buffer::ElementArrayBuffer), _indexCount(0), _indexType(GL_UNSIGNED_SHORT) {} + /** * @brief Constructor * @param primitive Primitive type diff --git a/src/Mesh.h b/src/Mesh.h index c1e3b5770..b811a6870 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -81,6 +81,15 @@ class Mesh { TriangleFan = GL_TRIANGLE_FAN }; + /** + * @brief Implicit constructor + * + * Allows creating the object without knowing anything about mesh data. + * Note that you have to call setPrimitive() and setVertexCount() + * manually for mesh to draw properly. + */ + inline Mesh(): _primitive(Triangles), _vertexCount(0), finalized(false) {} + /** * @brief Constructor * @param primitive Primitive type