add input

add time
add vertex color
This commit is contained in:
2025-09-24 11:44:51 +02:00
parent faa9b71510
commit c9e9dcf572
5 changed files with 51 additions and 15 deletions
+8
View File
@@ -38,6 +38,7 @@ int WINAPI WinMain(
// set render states
d3d.getDevice()->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
d3d.getDevice()->SetRenderState(D3DRS_LIGHTING, FALSE);
// 3. create a mesh
Mesh mesh = {};
@@ -67,6 +68,13 @@ int WINAPI WinMain(
// 8. run application
while (window.run())
{
if (GetAsyncKeyState(VK_F1) & 0x8000) d3d.getDevice()->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
if (GetAsyncKeyState(VK_F2) & 0x8000) d3d.getDevice()->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
if (GetAsyncKeyState(VK_F3) & 0x8000) d3d.getDevice()->SetRenderState(D3DRS_FILLMODE, D3DFILL_POINT);
if (GetAsyncKeyState(VK_F4) & 0x8000) d3d.getDevice()->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
if (GetAsyncKeyState(VK_F5) & 0x8000) d3d.getDevice()->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
if (GetAsyncKeyState(VK_F6) & 0x8000) d3d.getDevice()->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
// 8.1. update objects
time.update();
mesh.update(time.getDeltaTime());