Add input layout
Add matrix buffer Convert camera to D3D11
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 = {};
|
||||
@@ -75,14 +75,17 @@ 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();
|
||||
|
||||
//light.render(d3d.getDevice());
|
||||
material.render(d3d.getDevice());
|
||||
material.render(d3d.getDeviceContext());
|
||||
mesh.render(d3d.getDeviceContext());
|
||||
|
||||
d3d.endScene();
|
||||
|
||||
Reference in New Issue
Block a user