From c7dad1e929c0101386fbcdaa194e402d68f74752 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 23 Aug 2017 22:56:53 +0100 Subject: Updating docs --- camera2d_8hpp_source.html | 54 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 11 deletions(-) (limited to 'camera2d_8hpp_source.html') diff --git a/camera2d_8hpp_source.html b/camera2d_8hpp_source.html index 88e016c9..9033b153 100644 --- a/camera2d_8hpp_source.html +++ b/camera2d_8hpp_source.html @@ -9,6 +9,13 @@ + + + + + @@ -44,6 +51,21 @@ $(function() { }); + +
+ +
+
+
+ +
- -
camera2d.hpp
-
1 /* ----------------------------------------------------------------------------
2  * camera2d.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
5  * MIT License, see LICENSE file for more details.
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef CAMERA_2D_HPP
10 #define CAMERA_2D_HPP
11 
12 #include "glslprogram.hpp"
13 
14 #include <glm/glm.hpp>
15 #include <glm/gtc/matrix_transform.hpp>
16 
17 namespace yage {
18 
19 class Camera2D {
20 private:
21  bool matrix_needs_update_ = true;
22  float scale_ = 1;
23  glm::vec2 position_;
24  glm::mat4 camera_matrix_;
25  glm::mat4 ortho_matrix_;
26 
27 public:
28  Camera2D(int screen_width = 1280, int screen_height = 720);
29 
30  // update camera location
31  void update(GlslProgram& program);
32  // camera movement
33  void move(const glm::vec2& direction);
34 };
35 
36 } // yage
37 
38 #endif
Definition: camera2d.hpp:17
+Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * camera2d.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
5  * MIT License, see LICENSE file for more details.
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef CAMERA_2D_HPP
10 #define CAMERA_2D_HPP
11 
12 #include "glslprogram.hpp"
13 
14 #include <glm/glm.hpp>
15 #include <glm/gtc/matrix_transform.hpp>
16 
17 namespace yage {
18 
19 class Camera2D {
20 private:
21  bool matrix_needs_update_ = true;
22  float scale_ = 1;
23  glm::vec2 position_;
24  glm::mat4 camera_matrix_;
25  glm::mat4 ortho_matrix_;
26 
27 public:
28  Camera2D(int screen_width = 1280, int screen_height = 720);
29 
30  // update camera location
31  void update(GlslProgram& program);
32  // camera movement
33  void move(const glm::vec2& direction);
34 };
35 
36 } // yage
37 
38 #endif
glm::mat4 ortho_matrix_
Definition: camera2d.hpp:25
+
float scale_
Definition: camera2d.hpp:22
+
bool matrix_needs_update_
Definition: camera2d.hpp:21
+
glm::mat4 camera_matrix_
Definition: camera2d.hpp:24
+
void update(GlslProgram &program)
Definition: camera2d.cpp:21
+
Definition: glslprogram.hpp:18
+ +
glm::vec2 position_
Definition: camera2d.hpp:23
+
Definition: camera2d.hpp:19
+
Templated matrix class.
Definition: camera2d.hpp:17
+
void move(const glm::vec2 &direction)
Definition: camera2d.cpp:36
+
Camera2D(int screen_width=1280, int screen_height=720)
Definition: camera2d.cpp:15
+
- + -- cgit