Clean up of scene nodes to support 2d and non int positioning.
This commit is contained in:
parent
1eeaebd0a9
commit
672b31b603
45 changed files with 341 additions and 200 deletions
|
@ -39,7 +39,7 @@ void DirectXMesh::update(DrawingContext* context, ID3D12Device* device)
|
|||
y = 2 * y - 1;
|
||||
|
||||
Vertex vert;
|
||||
vert.position = DirectX::XMFLOAT3(x, y, 0.0);
|
||||
vert.position = DirectX::XMFLOAT3(static_cast<float>(x), static_cast<float>(y), 0.0);
|
||||
vert.color = DirectX::XMFLOAT4(color[0], color[1], color[2], color[3]);
|
||||
MLOG_INFO("Adding vert: " << x << " | " << y);
|
||||
mVertexBuffer.push_back(vert);
|
||||
|
@ -94,7 +94,7 @@ void DirectXMesh::createD3dVertexBuffer(ID3D12Device* device)
|
|||
|
||||
mVertexBufferView.BufferLocation = mD3dVertexBuffer->GetGPUVirtualAddress();
|
||||
mVertexBufferView.StrideInBytes = sizeof(Vertex);
|
||||
mVertexBufferView.SizeInBytes = buffer_size;
|
||||
mVertexBufferView.SizeInBytes = static_cast<UINT>(buffer_size);
|
||||
}
|
||||
|
||||
void DirectXMesh::uploadVertexBuffer(unsigned char* pBuffer) const
|
||||
|
@ -116,7 +116,7 @@ void DirectXMesh::createD3dIndexBuffer(ID3D12Device* device)
|
|||
mD3dIndexBuffer->Unmap(0, nullptr);
|
||||
|
||||
mIndexBufferView.BufferLocation = mD3dIndexBuffer->GetGPUVirtualAddress();
|
||||
mIndexBufferView.SizeInBytes = buffer_size;
|
||||
mIndexBufferView.SizeInBytes = static_cast<UINT>(buffer_size);
|
||||
mIndexBufferView.Format = DXGI_FORMAT_R16_UINT;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue