]> code.bitgloo.com Git - clyne/gamedev2.git/commitdiff
Added camera variable to render code
authorAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 7 Sep 2019 07:15:34 +0000 (03:15 -0400)
committerAndy Belle-Isle <drumsetmonkey@gmail.com>
Sat, 7 Sep 2019 07:15:34 +0000 (03:15 -0400)
src/render.cpp
src/render.hpp

index 7ae2fd74e0513da8e71ca10586d1824b7f06cfce..ceef025127081e13b798f05a2d950b89f90e74d4 100644 (file)
@@ -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;
 }
index 5d3025cee0fd048e9dd48211cb8550c265b70931..0e4275ed310cf0fddae59198c9118c1b01fe1c4c 100644 (file)
@@ -45,6 +45,7 @@ private:
     SDL_GLContext context;
 
     Shader worldShader;
+    glm::vec3 camPos;
 
 public:
     RenderSystem(void) :