diff options
| author | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
|---|---|---|
| committer | Marijn Tamis <[email protected]> | 2018-05-03 18:22:48 +0200 |
| commit | ca32c59a58d37c1822e185a2d5f3d0d3e8943593 (patch) | |
| tree | b06b9eec03f34344ef8fc31aa147b2714d3962ee /NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h | |
| parent | Forced rename of platform folders in cmake dir. Git didn't pick this up before. (diff) | |
| download | nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.tar.xz nvcloth-ca32c59a58d37c1822e185a2d5f3d0d3e8943593.zip | |
NvCloth 1.1.4 Release. (24070740)
Diffstat (limited to 'NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h')
| -rw-r--r-- | NvCloth/samples/SampleBase/renderer/CustomRenderMesh.h | 19 |
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; }; |