Terrain Window

This commit is contained in:
2024-03-28 10:13:06 +01:00
parent 9e7e33494c
commit 92ecd8e83a
8 changed files with 47 additions and 14 deletions

View File

@@ -244,7 +244,7 @@ bool ApplicationClass::Render(float rotation)
}
}
// Render terrainCube
// Render terrainCube after all the cubes have been combined
for (auto cube : m_terrainCubes)
{
cube->Render(m_Direct3D->GetDeviceContext());
@@ -263,6 +263,8 @@ bool ApplicationClass::Render(float rotation)
}
}
// Present the rendered scene to the screen.
m_Direct3D->EndScene();
@@ -309,9 +311,7 @@ void ApplicationClass::GenerateTerrain()
}
}
// Combine all the cubes into a single model
// TODO: Uncomment this line when you have implemented the CombineModels function in ModelClass
//m_Model->CombineModels(m_terrainCubes);
}
@@ -343,4 +343,14 @@ void ApplicationClass::DeleteCube(int index)
delete m_cubes[index];
m_cubes.erase(m_cubes.begin() + index);
}
}
void ApplicationClass::DeleteTerrain()
{
for (auto cube : m_terrainCubes)
{
cube->Shutdown();
delete cube;
}
m_terrainCubes.clear();
}