mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-12 16:14:25 +02:00
fixed #241
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user