From 354d7df4d2779ed7391701d1ef4344e959b64582 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 27 Dec 2017 19:21:12 +0000 Subject: [Broken] Texture is black. --- yage/core/camera.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'yage/core/camera.cpp') 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 #include @@ -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) -- cgit