Commit 497a4a14 authored by Martin Heistermann's avatar Martin Heistermann

Avoid adding empty render objects (prevents misguided runtime warnings).

These runtime warnings are not helpful, it may be intentional to have
an object that sometimes does not contain entities of a specific kind,
without changing the drawmode when this happens.

```
warning: numIndices is 0 in renderobject: VolumeMeshNodeVertices
warning: numIndices is 0 in renderobject: VolumeMeshNodeFaces
warning: numIndices is 0 in renderobject: VolumeMeshNodeEdges
```
parent 9a90b90d
......@@ -806,7 +806,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getCellRenderObjects(IRenderer* _renderer, GL
ro.vertexDecl = cellsBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_TRIANGLES, 0, cellsBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (cellsBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
template<class VolumeMeshT>
......@@ -868,7 +870,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getFaceRenderObjects(IRenderer* _renderer, GL
ro.vertexDecl = facesBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_TRIANGLES, 0, facesBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (facesBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
template<class VolumeMeshT>
......@@ -914,7 +918,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getEdgeRenderObjects(IRenderer* _renderer, GL
ro.vertexDecl = edgesBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_LINES, 0, edgesBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (edgesBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
template<class VolumeMeshT>
......@@ -957,7 +963,9 @@ void VolumeMeshNodeT<VolumeMeshT>::getVertexRenderObjects(IRenderer* _renderer,
ro.vertexDecl = verticesBufferManager_.getVertexDeclaration();
ro.glDrawArrays(GL_POINTS, 0, verticesBufferManager_.getNumOfVertices());
_renderer->addRenderObject(&ro);
if (verticesBufferManager_.getNumOfVertices() > 0) {
_renderer->addRenderObject(&ro);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment