aboutsummaryrefslogtreecommitdiff
path: root/NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h
diff options
context:
space:
mode:
Diffstat (limited to 'NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h')
-rw-r--r--NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h b/NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h
index c00eafc..93eb322 100644
--- a/NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h
+++ b/NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h
@@ -18,16 +18,27 @@ class CustomRenderMesh : public IRenderMesh
{
public:
const std::vector<D3D11_INPUT_ELEMENT_DESC>& getInputElementDesc() const { return m_inputDesc; }
- void render(ID3D11DeviceContext& context) const;
+ void render(ID3D11DeviceContext& context, int submesh) const;
+
+ //flags
+ enum
+ {
+ DYNAMIC_VERTEX_BUFFER = 1
+ };
CustomRenderMesh(const void* vertices, uint32_t numVertices, uint32_t vertexSize,
- std::vector<D3D11_INPUT_ELEMENT_DESC>& inputDesc, const uint16_t* faces = nullptr, uint32_t numFaces = 0);
+ std::vector<D3D11_INPUT_ELEMENT_DESC>& inputDesc, const uint16_t* faces = nullptr, uint32_t numFaces = 0, int flags = 0);
virtual ~CustomRenderMesh();
+ void updateVertices(const void* vertices, uint32_t numVertices, uint32_t vertexSize);
+ uint32_t getVertexCapacity() const { return m_vertexCapacity; }
+ uint32_t getIndexCapacity() const { return m_indexCapacity; }
+
+
protected:
CustomRenderMesh();
void initialize(const void* vertices, uint32_t numVertices, uint32_t vertexSize,
- std::vector<D3D11_INPUT_ELEMENT_DESC>& inputDesc, const uint16_t* faces, uint32_t numFaces);
+ std::vector<D3D11_INPUT_ELEMENT_DESC>& inputDesc, const uint16_t* faces, uint32_t numFaces, int flags);
private:
ID3D11Buffer* m_vertexBuffer;
@@ -35,6 +46,8 @@ private:
uint32_t m_numFaces;
uint32_t m_numVertices;
uint32_t m_vertexSize;
+ uint32_t m_vertexCapacity;
+ uint32_t m_indexCapacity;
std::vector<D3D11_INPUT_ELEMENT_DESC> m_inputDesc;
};