summaryrefslogtreecommitdiff
path: root/application
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-01-24 16:36:02 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-01-24 16:36:02 +0000
commit1c3e7e81049efefe8b54e4d4a719feeda995b474 (patch)
tree3a5474dfbc515c16589ae6863fba1116d7b83ec3 /application
parentBig tidy up of shader wrapper (diff)
downloadilt-1c3e7e81049efefe8b54e4d4a719feeda995b474.tar.bz2
ilt-1c3e7e81049efefe8b54e4d4a719feeda995b474.tar.xz
ilt-1c3e7e81049efefe8b54e4d4a719feeda995b474.zip
Remove the weird view/model/camera connectedness
Diffstat (limited to 'application')
-rw-r--r--application/main.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/application/main.cpp b/application/main.cpp
index 63ceac0..015f128 100644
--- a/application/main.cpp
+++ b/application/main.cpp
@@ -68,6 +68,8 @@ public:
Shader shader;
Camera camera({0.0F, 0.0F, -5.0F}, 70.0F, (float)DISPLAY_WIDTH / (float)DISPLAY_HEIGHT, 0.1F, 100.0F);
+ shader.Bind();
+ shader.setView(camera.GetViewProjection());
SDL_Event e;
bool isRunning = true;
@@ -87,8 +89,7 @@ public:
world.apply(&WorldObject::tick, t_passed);
windows.apply(&Window::Clear, 0.0F, 0.0F, 0.0F, 1.0F);
- shader.Bind();
- world.apply<Physical>(&Physical::render, shader, camera);
+ world.apply<Physical>(&Physical::render, shader);
windows.apply(&Window::SwapBuffers);
if (const auto snz = framelen - t_passed; snz.count() > 0) {