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