|
@@ -39,9 +39,9 @@ public:
|
39
|
39
|
};
|
40
|
40
|
DKArray<Vertex> vertexData =
|
41
|
41
|
{
|
42
|
|
- { { 1.0f, 1.0f, 0.0f },{ 1.0f, 0.0f, 0.0f } },
|
43
|
|
- { { -1.0f, 1.0f, 0.0f },{ 0.0f, 1.0f, 0.0f } },
|
44
|
|
- { { 0.0f, -1.0f, 0.0f },{ 0.0f, 0.0f, 1.0f } }
|
|
42
|
+ { { 0.0f, -0.5f, 0.0f },{ 1.0f, 1.0f, 1.0f } },
|
|
43
|
+ { { 0.5f, 0.5f, 0.0f },{ 0.0f, 1.0f, 0.0f } },
|
|
44
|
+ { { -0.5f, 0.5f, 0.0f },{ 0.0f, 0.0f, 1.0f } }
|
45
|
45
|
};
|
46
|
46
|
uint32_t vertexBufferSize = static_cast<uint32_t>(vertexData.Count()) * sizeof(Vertex);
|
47
|
47
|
DKArray<uint32_t> indexData = { 0, 1, 2 };
|
|
@@ -61,6 +61,7 @@ public:
|
61
|
61
|
pipelineDescriptor.colorAttachments.Resize(1);
|
62
|
62
|
pipelineDescriptor.colorAttachments.Value(0).pixelFormat = swapChain->ColorPixelFormat();
|
63
|
63
|
pipelineDescriptor.rasterizationEnabled = true;
|
|
64
|
+ pipelineDescriptor.primitiveTopology = DKPrimitiveTopology::Triangles;
|
64
|
65
|
pipelineDescriptor.vertexDescriptor.attributes = {
|
65
|
66
|
{ DKVertexFormat::Float3, 0, 0, 0 },
|
66
|
67
|
{ DKVertexFormat::Float3, sizeof(DKVector3), 0, 1 },
|
|
@@ -90,7 +91,7 @@ public:
|
90
|
91
|
encoder->SetVertexBuffer(vertexBuffer, 0, 0);
|
91
|
92
|
encoder->SetIndexBuffer(indexBuffer, 0, DKIndexType::UInt32);
|
92
|
93
|
// draw scene!
|
93
|
|
- encoder->DrawIndexed(indexData.Count(), 1, 0, 0, 0);
|
|
94
|
+ encoder->DrawIndexed(indexData.Count(), 1, 0, 0, 1);
|
94
|
95
|
encoder->EndEncoding();
|
95
|
96
|
buffer->Commit();
|
96
|
97
|
swapChain->Present();
|