aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Belle-Isle <drumsetmonkey@gmail.com>2019-09-07 03:15:34 -0400
committerAndy Belle-Isle <drumsetmonkey@gmail.com>2019-09-07 03:15:34 -0400
commitd737454d32981282b1dd9de44ebd03a2d0a39f0d (patch)
tree5aff05ade353226af68e96a61def8eeb520adcc1 /src
parenta5af0d986ca40c592580dbe743a3adb0cfd476de (diff)
Added camera variable to render code
Diffstat (limited to 'src')
-rw-r--r--src/render.cpp4
-rw-r--r--src/render.hpp1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/render.cpp b/src/render.cpp
index 7ae2fd7..ceef025 100644
--- a/src/render.cpp
+++ b/src/render.cpp
@@ -51,7 +51,7 @@ void RenderSystem::update([[maybe_unused]] entityx::EntityManager& entities,
* SETUP *
***********/
- glm::mat4 view = glm::lookAt(glm::vec3(0.0f, 0.0f, 5.0f), // Pos
+ glm::mat4 view = glm::lookAt(camPos, // Pos
glm::vec3(0.0f, 0.0f, 0.0f), // Facing
glm::vec3(0.0f, 1.0f, 0.0f)); // Up
@@ -260,6 +260,8 @@ int RenderSystem::init(void)
//glPolygonOffset(1.0, 1.0);
//glClearColor(0.6, 0.8, 1.0, 0.0);
+
+ camPos = glm::vec3(0.0f, 0.0f, 0.5f);
return 0;
}
diff --git a/src/render.hpp b/src/render.hpp
index 5d3025c..0e4275e 100644
--- a/src/render.hpp
+++ b/src/render.hpp
@@ -45,6 +45,7 @@ private:
SDL_GLContext context;
Shader worldShader;
+ glm::vec3 camPos;
public:
RenderSystem(void) :