add wall texture

add WICTextureLoader
add uv coordinates
This commit is contained in:
2025-11-12 14:09:20 +01:00
parent 6470789977
commit a39f37ac4e
9 changed files with 783 additions and 15 deletions
+22 -9
View File
@@ -128,18 +128,31 @@ UINT Mesh::createVertexBuffer(IDirect3DDevice9* pD3DDevice)
//pVertices[2] = Vertex(0.5f, -0.5f, 0.0f);
//pVertices[3] = Vertex(-0.5f, -0.5f, 0.0f);
// cube
//// cube with color
//// front
//pVertices[0] = Vertex(-0.5f, 0.5f, -0.5f, 255, 0, 0);
//pVertices[1] = Vertex(0.5f, 0.5f, -0.5f, 0, 255, 0);
//pVertices[2] = Vertex(0.5f, -0.5f, -0.5f, 0, 0, 255);
//pVertices[3] = Vertex(-0.5f, -0.5f, -0.5f, 255, 0, 255);
//// back
//pVertices[4] = Vertex(0.5f, 0.5f, 0.5f, 255, 255, 0);
//pVertices[5] = Vertex(-0.5f, 0.5f, 0.5f, 0, 255, 255);
//pVertices[6] = Vertex(-0.5f, -0.5f, 0.5f, 0, 0, 0);
//pVertices[7] = Vertex(0.5f, -0.5f, 0.5f, 200, 200, 200);
// cube with uv
// front
pVertices[0] = Vertex(-0.5f, 0.5f, -0.5f, 255, 0, 0);
pVertices[1] = Vertex(0.5f, 0.5f, -0.5f, 0, 255, 0);
pVertices[2] = Vertex(0.5f, -0.5f, -0.5f, 0, 0, 255);
pVertices[3] = Vertex(-0.5f, -0.5f, -0.5f, 255, 0, 255);
pVertices[0] = Vertex(-0.5f, 0.5f, -0.5f, 0.0f, 0.0f);
pVertices[1] = Vertex(0.5f, 0.5f, -0.5f, 1.0f, 0.0f);
pVertices[2] = Vertex(0.5f, -0.5f, -0.5f, 1.0f, 1.0f);
pVertices[3] = Vertex(-0.5f, -0.5f, -0.5f, 0.0f, 1.0f);
// back
pVertices[4] = Vertex(0.5f, 0.5f, 0.5f, 255, 255, 0);
pVertices[5] = Vertex(-0.5f, 0.5f, 0.5f, 0, 255, 255);
pVertices[6] = Vertex(-0.5f, -0.5f, 0.5f, 0, 0, 0);
pVertices[7] = Vertex(0.5f, -0.5f, 0.5f, 200, 200, 200);
pVertices[4] = Vertex(0.5f, 0.5f, 0.5f, 0.0f, 0.0f);
pVertices[5] = Vertex(-0.5f, 0.5f, 0.5f, 1.0f, 0.0f);
pVertices[6] = Vertex(-0.5f, -0.5f, 0.5f, 1.0f, 1.0f);
pVertices[7] = Vertex(0.5f, -0.5f, 0.5f, 0.0f, 1.0f);
hr = _pVertexBuffer->Unlock();
CheckFailed(hr, 320);