17 D3D11_BUFFER_DESC desc;
19 desc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
21 desc.StructureByteStride = 0;
25 desc.Usage = D3D11_USAGE_IMMUTABLE;
30 desc.Usage = D3D11_USAGE_DYNAMIC;
31 desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
36 LogError(
"Vertex output streams are not yet tested.");
37 desc.Usage = D3D11_USAGE_DEFAULT;
38 desc.BindFlags |= D3D11_BIND_STREAM_OUTPUT;
43 ID3D11Buffer*
buffer =
nullptr;
47 D3D11_SUBRESOURCE_DATA
data;
48 data.pSysMem = vbuffer->
GetData();
50 data.SysMemSlicePitch = 0;
51 hr = device->CreateBuffer(&desc, &data, &buffer);
55 hr = device->CreateBuffer(&desc,
nullptr, & buffer);
71 return std::make_shared<DX11VertexBuffer>(
reinterpret_cast<ID3D11Device*
>(device),
72 static_cast<VertexBuffer const*>(
object));
97 context->IASetVertexBuffers(0, 1, buffers, strides, offsets);
105 ID3D11Buffer*
buffers[1] = {
nullptr };
108 context->IASetVertexBuffers(0, 1, buffers, strides, offsets);
#define D3D11_RESOURCE_MISC_NONE
DX11VertexBuffer(ID3D11Device *device, VertexBuffer const *vbuffer)
#define CHECK_HR_RETURN_NONE(msg)
ID3D11Buffer * GetDXBuffer() const
GraphicsObjectType GetType() const
GLuint GLsizei const GLuint const GLintptr * offsets
unsigned int GetElementSize() const
#define LogError(message)
ID3D11DeviceChild * mDXObject
void Enable(ID3D11DeviceContext *context)
unsigned int GetNumBytes() const
void CreateStaging(ID3D11Device *device, D3D11_BUFFER_DESC const &bf)
char const * GetData() const
void Disable(ID3D11DeviceContext *context)
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
GLsizeiptr const void GLenum usage
#define D3D11_CPU_ACCESS_NONE
CopyType GetCopyType() const
typedef UINT(WINAPI *PFNWGLGETGPUIDSAMDPROC)(UINT maxCount
VertexBuffer * GetVertexBuffer() const
GLsizei const GLuint const GLintptr const GLsizei * strides