15 mFormat(ibuffer->GetElementSize() == sizeof(unsigned
int) ?
16 DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT)
19 D3D11_BUFFER_DESC desc;
21 desc.BindFlags = D3D11_BIND_INDEX_BUFFER;
23 desc.StructureByteStride = 0;
27 desc.Usage = D3D11_USAGE_IMMUTABLE;
32 desc.Usage = D3D11_USAGE_DYNAMIC;
33 desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
37 desc.Usage = D3D11_USAGE_DEFAULT;
42 ID3D11Buffer*
buffer =
nullptr;
46 D3D11_SUBRESOURCE_DATA
data;
47 data.pSysMem = ibuffer->
GetData();
49 data.SysMemSlicePitch = 0;
50 hr = device->CreateBuffer(&desc, &data, &buffer);
54 hr = device->CreateBuffer(&desc,
nullptr, &buffer);
70 return std::make_shared<DX11IndexBuffer>(
71 reinterpret_cast<ID3D11Device*
>(device),
72 static_cast<IndexBuffer const*>(
object));
83 ID3D11Buffer* dxBuffer =
static_cast<ID3D11Buffer*
>(
mDXObject);
84 context->IASetIndexBuffer(dxBuffer,
mFormat, 0);
92 context->IASetIndexBuffer(0, DXGI_FORMAT_UNKNOWN, 0);
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
#define D3D11_RESOURCE_MISC_NONE
#define CHECK_HR_RETURN_NONE(msg)
GraphicsObjectType GetType() const
void Enable(ID3D11DeviceContext *context)
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
#define LogError(message)
ID3D11DeviceChild * mDXObject
unsigned int GetNumBytes() const
void CreateStaging(ID3D11Device *device, D3D11_BUFFER_DESC const &bf)
char const * GetData() const
GLsizeiptr const void GLenum usage
DX11IndexBuffer(ID3D11Device *device, IndexBuffer const *vbuffer)
#define D3D11_CPU_ACCESS_NONE
void Disable(ID3D11DeviceContext *context)
CopyType GetCopyType() const