YAGE  v0.1.3.0
Yet Another Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
camera.h
Go to the documentation of this file.
1 
9 #ifndef YAGE_CAMERA2D_H
10 #define YAGE_CAMERA2D_H
11 
12 #include <glm/glm.hpp>
13 
14 namespace yage
15 {
16 
17 class GlslProgram;
18 
19 class Camera
20 {
21 private:
22  bool update_matrix_ = true;
23  float scale_ = 1;
24  glm::vec2 position_;
25  glm::mat4 camera_matrix_;
26  glm::mat4 ortho_matrix_;
27 
28 public:
29  Camera(int screen_width = 1280, int screen_height = 720);
30 
31  void update(GlslProgram &program);
32  void move(const glm::vec2 &direction);
33 };
34 
35 } // namespace yage
36 
37 #endif
float scale_
Definition: camera.h:23
bool update_matrix_
Definition: camera.h:22
Definition: camera.h:19
Definition: glslprogram.h:19
void update(GlslProgram &program)
Definition: camera.cpp:25
glm::vec2 position_
Definition: camera.h:24
Camera(int screen_width=1280, int screen_height=720)
Definition: camera.cpp:18
void move(const glm::vec2 &direction)
Definition: camera.cpp:41
glm::mat4 ortho_matrix_
Definition: camera.h:26
glm::mat4 camera_matrix_
Definition: camera.h:25