1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
// Set the number of vertices in the vertex array.
m_vertexCount = 4;
// Set the number of indices in the index array.
m_indexCount = 4;
vertices = new VertexType[m_vertexCount];
indices = new unsigned long[m_indexCount];
// Load the vertex array with data.
vertices[0].position = D3DXVECTOR3(-1.0f, -1.0f, 0.0f); // Bottom left.
vertices[0].color = D3DXVECTOR4(0.0f, 1.0f, 0.0f, 1.0f);
vertices[1].position = D3DXVECTOR3(-1.0f, 1.0f, 0.0f); // Top left.
vertices[1].color = D3DXVECTOR4(0.0f, 1.0f, 0.0f, 1.0f);
vertices[2].position = D3DXVECTOR3(1.0f, 1.0f, 0.0f); // Top right.
vertices[2].color = D3DXVECTOR4(0.0f, 1.0f, 0.0f, 1.0f);
vertices[3].position = D3DXVECTOR3(1.0f, 1.0f, 0.0f); // top right.
vertices[3].color = D3DXVECTOR4(0.0f, 1.0f, 0.0f, 1.0f);
vertices[4].position = D3DXVECTOR3(1.0f, -1.0f, 0.0f); // Bottom right.
vertices[4].color = D3DXVECTOR4(0.0f, 1.0f, 0.0f, 1.0f);
vertices[5].position = D3DXVECTOR3(-1.0f, -1.0f, 0.0f); // bottom left
vertices[5].color = D3DXVECTOR4(0.0f, 1.0f, 0.0f, 1.0f);
|