From 5403490b941f7c031bf1aafdb91b1098f69edbf2 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Thu, 24 Aug 2017 00:21:07 +0100 Subject: Running clang-format over everything. Edited formatting and ran it over all the files. --- src/camera2d.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/camera2d.cpp') diff --git a/src/camera2d.cpp b/src/camera2d.cpp index 690ac98d..9f210ddc 100644 --- a/src/camera2d.cpp +++ b/src/camera2d.cpp @@ -10,15 +10,18 @@ #include -namespace yage { +namespace yage +{ Camera2D::Camera2D(int screen_width, int screen_height) - : position_(0.f, 0.f), - camera_matrix_(1.f), + : position_(0.f, 0.f), camera_matrix_(1.f), ortho_matrix_( - glm::ortho(0.f, (float)screen_width, 0.f, (float)screen_height)) {} + glm::ortho(0.f, (float)screen_width, 0.f, (float)screen_height)) +{ +} -void Camera2D::update(GlslProgram& program) { +void Camera2D::update(GlslProgram &program) +{ if (matrix_needs_update_) { glm::vec3 translate(-position_.x, -position_.y, 0.f); glm::vec3 scale(scale_, scale_, 0.f); @@ -33,9 +36,10 @@ void Camera2D::update(GlslProgram& program) { glUniformMatrix4fv(matrix_location, 1, GL_FALSE, &(camera_matrix_[0][0])); } -void Camera2D::move(const glm::vec2& direction) { +void Camera2D::move(const glm::vec2 &direction) +{ position_ += direction; matrix_needs_update_ = true; } -} // yage +} // yage -- cgit