Browse Source

Doc: crosslinking MeshTools and relevant Mesh functions.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
b3517eda01
  1. 1
      src/IndexedMesh.h
  2. 1
      src/Mesh.h
  3. 5
      src/MeshTools/CompressIndices.h
  4. 9
      src/MeshTools/Interleave.h

1
src/IndexedMesh.h

@ -55,6 +55,7 @@ class MAGNUM_EXPORT IndexedMesh: public Mesh {
* @brief Set index count * @brief Set index count
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
* *
* @see MeshTools::compressIndices()
* @todo definalize after that? * @todo definalize after that?
*/ */
inline IndexedMesh* setIndexCount(GLsizei count) { inline IndexedMesh* setIndexCount(GLsizei count) {

1
src/Mesh.h

@ -365,6 +365,7 @@ class MAGNUM_EXPORT Mesh {
* @return Pointer to self (for method chaining) * @return Pointer to self (for method chaining)
* *
* This forces recalculation of attribute positions upon next drawing. * This forces recalculation of attribute positions upon next drawing.
* @see MeshTools::interleave()
*/ */
inline Mesh* setVertexCount(GLsizei vertexCount) { inline Mesh* setVertexCount(GLsizei vertexCount) {
_vertexCount = vertexCount; _vertexCount = vertexCount;

5
src/MeshTools/CompressIndices.h

@ -90,7 +90,10 @@ inline std::tuple<size_t, Type, char*> compressIndices(const std::vector<unsigne
The same as compressIndices(const std::vector<unsigned int>&), but this The same as compressIndices(const std::vector<unsigned int>&), but this
function writes the output to mesh's index buffer and updates index count and function writes the output to mesh's index buffer and updates index count and
type in the mesh accordingly. type in the mesh accordingly, so you don't have to call Mesh::setIndexCount()
and Mesh::setIndexType() on your own.
@see MeshTools::interleave()
*/ */
inline void compressIndices(IndexedMesh* mesh, Buffer::Usage usage, const std::vector<unsigned int>& indices) { inline void compressIndices(IndexedMesh* mesh, Buffer::Usage usage, const std::vector<unsigned int>& indices) {
return Implementation::CompressIndices{indices}(mesh, usage); return Implementation::CompressIndices{indices}(mesh, usage);

9
src/MeshTools/Interleave.h

@ -149,8 +149,11 @@ template<class T, class ...U> inline typename std::enable_if<!std::is_convertibl
@param usage Array buffer usage @param usage Array buffer usage
The same as interleave(const T&, const U&...), but this function writes the The same as interleave(const T&, const U&...), but this function writes the
output to given array buffer and updates vertex count in the mesh accordingly. output to given array buffer and updates vertex count in the mesh accordingly,
Binding the attributes to shader is left to user. so you don't have to call Mesh::setVertexCount() on your own.
@attention Setting primitive type and binding the attributes to shader is left
to user - see Mesh::setPrimitive() and Mesh::bindAttribute().
For only one attribute array this function is convenient equivalent to the For only one attribute array this function is convenient equivalent to the
following, without any performance loss: following, without any performance loss:
@ -162,6 +165,8 @@ mesh->setVertexCount(attribute.size());
@attention If there is more than one attribute array, the buffer must be set @attention If there is more than one attribute array, the buffer must be set
as interleaved (see Mesh::addBuffer()), otherwise this function does as interleaved (see Mesh::addBuffer()), otherwise this function does
nothing. nothing.
@see MeshTools::compressIndices()
*/ */
template<class ...T> inline void interleave(Mesh* mesh, Buffer* buffer, Buffer::Usage usage, const T&... attributes) { template<class ...T> inline void interleave(Mesh* mesh, Buffer* buffer, Buffer::Usage usage, const T&... attributes) {
return Implementation::Interleave()(mesh, buffer, usage, attributes...); return Implementation::Interleave()(mesh, buffer, usage, attributes...);

Loading…
Cancel
Save