From c7a4c960727b8f6d170ff82690f3b703c5a0179d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 4 Jun 2023 15:20:39 +0200 Subject: [PATCH] MeshTools: show an example sequence for each generate*Indices() API. Makes it easier to see what these are doing. --- src/Magnum/MeshTools/GenerateIndices.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/Magnum/MeshTools/GenerateIndices.h b/src/Magnum/MeshTools/GenerateIndices.h index 16e9fb42a..b6360b3ce 100644 --- a/src/Magnum/MeshTools/GenerateIndices.h +++ b/src/Magnum/MeshTools/GenerateIndices.h @@ -53,10 +53,11 @@ MAGNUM_MESHTOOLS_EXPORT UnsignedInt primitiveCount(MeshPrimitive primitive, Unsi @brief Create index buffer for a line strip primitive @m_since{2020,06} -Can be used to convert a @ref MeshPrimitive::LineStrip mesh to -@ref MeshPrimitive::Lines. The @p vertexCount is expected to be either -@cpp 0 @ce or at least @cpp 2 @ce. Primitive restart is not supported. If the -mesh is already indexed, use @ref generateLineStripIndices(const Containers::StridedArrayView1D&) +Generates a @cpp 0, 1, 1, 2, 3, 4, ... @ce sequence. Can be used to convert a +@ref MeshPrimitive::LineStrip mesh to @ref MeshPrimitive::Lines. The +@p vertexCount is expected to be either @cpp 0 @ce or at least @cpp 2 @ce. +Primitive restart is not supported. If the mesh is already indexed, use +@ref generateLineStripIndices(const Containers::StridedArrayView1D&) and overloads instead. @see @ref generateLineStripIndicesInto(), @ref generateLineLoopIndices(), @ref generateTriangleStripIndices(), @ref generateTriangleFanIndices(), @@ -145,10 +146,10 @@ MAGNUM_MESHTOOLS_EXPORT void generateLineStripIndicesInto(const Containers::Stri @brief Create index buffer for a line loop primitive @m_since{2020,06} -Can be used to convert a @ref MeshPrimitive::LineLoop mesh to -@ref MeshPrimitive::Lines. The @p vertexCount is expected to be either -@cpp 0 @ce or at least @cpp 2 @ce. Primitive restart is not supported. If the -mesh is already indexed, use @ref generateLineLoopIndices(const Containers::StridedArrayView1D&) +Generates a @cpp 0, 1, 1, 2, 3, ..., 0 @ce sequence. Can be used to convert a @ref MeshPrimitive::LineLoop mesh to @ref MeshPrimitive::Lines. The +@p vertexCount is expected to be either @cpp 0 @ce or at least @cpp 2 @ce. +Primitive restart is not supported. If the mesh is already indexed, use +@ref generateLineLoopIndices(const Containers::StridedArrayView1D&) and overloads instead. @see @ref generateLineLoopIndicesInto(), @ref generateLineStripIndices(), @ref generateTriangleStripIndices(), @ref generateTriangleFanIndices(), @@ -237,7 +238,8 @@ MAGNUM_MESHTOOLS_EXPORT void generateLineLoopIndicesInto(const Containers::Strid @brief Create index buffer for a triangle strip primitive @m_since{2020,06} -Can be used to convert a @ref MeshPrimitive::TriangleStrip mesh to +Generates a @cpp 0, 1, 2, 2, 1, 3, 2, 3, 4, ... @ce sequence. Can be used to +convert a @ref MeshPrimitive::TriangleStrip mesh to @ref MeshPrimitive::Triangles. The @p vertexCount is expected to be either @cpp 0 @ce or at least @cpp 3 @ce. Primitive restart is not supported. If the mesh is already indexed, use @ref generateTriangleStripIndices(const Containers::StridedArrayView1D&) @@ -329,7 +331,8 @@ MAGNUM_MESHTOOLS_EXPORT void generateTriangleStripIndicesInto(const Containers:: @brief Create index buffer for a triangle fan primitive @m_since{2020,06} -Can be used to convert a @ref MeshPrimitive::TriangleFan mesh to +Generates a @cpp 0, 1, 2, 0, 2, 3, 0, 3, 4, ... @ce sequence. Can be used to +convert a @ref MeshPrimitive::TriangleFan mesh to @ref MeshPrimitive::Triangles. The @p vertexCount is expected to be either @cpp 0 @ce or at least @cpp 3 @ce. Primitive restart is not supported. If the mesh is already indexed, use @ref generateTriangleFanIndices(const Containers::StridedArrayView1D&)