aboutsummaryrefslogtreecommitdiffstats
path: root/yage/core/camera.cpp
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-12-27 19:21:12 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-12-27 19:21:12 +0000
commit354d7df4d2779ed7391701d1ef4344e959b64582 (patch)
tree81ecdc8d323cae78a86fb9c99524f57c705eeabc /yage/core/camera.cpp
parentf949692714e72a0e2d45ebb6a5d698424ab71dee (diff)
downloadYAGE-354d7df4d2779ed7391701d1ef4344e959b64582.tar.gz
YAGE-354d7df4d2779ed7391701d1ef4344e959b64582.zip
[Broken] Texture is black.
Diffstat (limited to 'yage/core/camera.cpp')
-rw-r--r--yage/core/camera.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/yage/core/camera.cpp b/yage/core/camera.cpp
index 71938cbb..c492351f 100644
--- a/yage/core/camera.cpp
+++ b/yage/core/camera.cpp
@@ -7,7 +7,7 @@
*/
#include "camera.h"
-#include "glslprogram.h"
+#include "../render/shader.h"
#include <glad/glad.h>
#include <glm/gtc/matrix_transform.hpp>
@@ -22,7 +22,7 @@ Camera::Camera(int screen_width, int screen_height)
{
}
-void Camera::update(GlslProgram &program)
+void Camera::update(Shader &program)
{
if (update_matrix_) {
glm::vec3 translate(-position_.x, -position_.y, 0.f);
@@ -34,8 +34,7 @@ void Camera::update(GlslProgram &program)
update_matrix_ = false;
}
- GLint matrix_location = program.getUniformLocation("P");
- glUniformMatrix4fv(matrix_location, 1, GL_FALSE, &(camera_matrix_[0][0]));
+ program.setUniform("P", camera_matrix_);
}
void Camera::move(const glm::vec2 &direction)