25 #ifndef OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
26 #define OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
28 #include "../version.h"
33 struct ID3D11DeviceContext;
35 namespace OpenSubdiv {
36 namespace OPENSUBDIV_VERSION {
52 ID3D11DeviceContext *deviceContext);
59 void UpdateData(
const float *src,
int startVertex,
int numVertices,
60 void *deviceContext = NULL);
75 ID3D11Buffer *
BindVBO(ID3D11DeviceContext *deviceContext) {
88 ID3D11Buffer *_d3d11Buffer;
95 using namespace OPENSUBDIV_VERSION;
99 #endif // OPENSUBDIV3_OSD_CPU_D3D11_VERTEX_BUFFER_H
ID3D11Buffer * BindD3D11Buffer(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object.
int GetNumVertices() const
Returns how many vertices allocated in this vertex buffer.
virtual ~CpuD3D11VertexBuffer()
Destructor.
int GetNumElements() const
Returns how many elements defined in this vertex buffer.
ID3D11Buffer * BindVBO(ID3D11DeviceContext *deviceContext)
Returns the D3D11 buffer object (for Osd::Mesh interface)
void UpdateData(const float *src, int startVertex, int numVertices, void *deviceContext=NULL)
Concrete vertex buffer class for Cpu subdivision and DirectX drawing.
static CpuD3D11VertexBuffer * Create(int numElements, int numVertices, ID3D11DeviceContext *deviceContext)
Creator. Returns NULL if error.
bool allocate(ID3D11Device *device)
float * BindCpuBuffer()
Returns the address of CPU buffer.
CpuD3D11VertexBuffer(int numElements, int numVertices)
Constructor.