151 VertexType* vertices;
152 D3D11_MAPPED_SUBRESOURCE mappedResource;
153 VertexType* verticesPtr;
162 return CO_E_ERRORINAPP;
170 D3DXVECTOR2 topLeft = { left, top };
171 D3DXVECTOR2 bottomRight = { right, bottom };
172 D3DXVECTOR2 topRight = { right, top };
173 D3DXVECTOR2 bottomLeft = { left, bottom };
180 vertices[0].position = D3DXVECTOR3(topLeft.x, topLeft.y, 0.0f);
181 vertices[0].texture = D3DXVECTOR2(0.0f, 0.0f);
182 vertices[1].position = D3DXVECTOR3(bottomRight.x, bottomRight.y, 0.0f);
183 vertices[1].texture = D3DXVECTOR2(1.0f, 1.0f);
184 vertices[2].position = D3DXVECTOR3(bottomLeft.x, bottomLeft.y, 0.0f);
185 vertices[2].texture = D3DXVECTOR2(0.0f, 1.0f);
187 vertices[3].position = D3DXVECTOR3(topLeft.x, topLeft.y, 0.0f);
188 vertices[3].texture = D3DXVECTOR2(0.0f, 0.0f);
189 vertices[4].position = D3DXVECTOR3(topRight.x, topRight.y, 0.0f);
190 vertices[4].texture = D3DXVECTOR2(1.0f, 0.0f);
191 vertices[5].position = D3DXVECTOR3(bottomRight.x, bottomRight.y, 0.0f);
192 vertices[5].texture = D3DXVECTOR2(1.0f, 1.0f);
194 result = deviceContext->Map(
_vertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
197 return CO_E_ERRORINAPP;
200 verticesPtr = (VertexType*)mappedResource.pData;
201 memcpy(verticesPtr, (
void*)vertices, (
sizeof(VertexType) *
_vertexCount));