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