1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-13 16:44:50 +02:00
This commit is contained in:
XProger
2020-02-17 03:19:41 +03:00
parent f85809e0dd
commit 1b2f125ed6
2 changed files with 2 additions and 2 deletions

View File

@@ -500,7 +500,7 @@ namespace GAPI {
void bind(const MeshRange &range) const {
UINT stride = sizeof(Vertex);
UINT offset = 0;//range.vStart * stride;
deviceContext->IASetIndexBuffer(IB, DXGI_FORMAT_R16_UINT, 0);
deviceContext->IASetIndexBuffer(IB, sizeof(Index) == 2 ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT, 0);
deviceContext->IASetVertexBuffers(0, 1, &VB, &stride, &offset);
}

View File

@@ -401,7 +401,7 @@ namespace GAPI {
uint32 usage = D3DUSAGE_WRITEONLY | (dynamic ? D3DUSAGE_DYNAMIC : 0);
D3DPOOL pool = dynamic ? D3DPOOL_DEFAULT : D3DPOOL_MANAGED;
D3DCHECK(device->CreateIndexBuffer (iCount * sizeof(Index), usage, D3DFMT_INDEX16, pool, &IB, NULL));
D3DCHECK(device->CreateIndexBuffer (iCount * sizeof(Index), usage, sizeof(Index) == 2 ? D3DFMT_INDEX16 : D3DFMT_INDEX32, pool, &IB, NULL));
D3DCHECK(device->CreateVertexBuffer (vCount * sizeof(Vertex), usage, D3DFMT_UNKNOWN, pool, &VB, NULL));
update(indices, iCount, vertices, vCount);