Add matrix buffer

Convert camera to D3D11
Add world, view & projection matrix exposing
This commit is contained in:
2026-11-27 12:17:17 +01:00
parent ead7463b8e
commit c6fdf567b7
8 changed files with 89 additions and 25 deletions
+9 -6
View File
@@ -37,10 +37,10 @@ int WINAPI WinMain(
error = mesh.init(d3d.getDevice());
CheckError(error);
//// 4. create a camera
//Camera camera = {};
//error = camera.init(d3d.getDevice(), width, height);
//CheckError(error);
// 4. create a camera
Camera camera = {};
error = camera.init(width, height);
CheckError(error);
// 5. create time
Time time = {};
@@ -70,9 +70,12 @@ int WINAPI WinMain(
// 8.1. update objects
time.update();
mesh.update(time.getDeltaTime());
//camera.update(time.getDeltaTime());
camera.update(time.getDeltaTime());
//light.update(time.getDeltaTime());
material.setMatrices(
d3d.getDeviceContext(), mesh.getWorldMatrix(), camera.getViewMatrix(), camera.getProjectionMatrix());
// 8.2. render objects
d3d.beginScene();
@@ -87,7 +90,7 @@ int WINAPI WinMain(
//light.deInit();
material.deInit();
time.deInit();
//camera.deInit();
camera.deInit();
mesh.deInit();
d3d.deInit();
window.deInit();