Add matrix buffer
Convert camera to D3D11 Add world, view & projection matrix exposing
This commit is contained in:
+9
-6
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user