]> git.localhorst.tv Git - blank.git/blob - src/graphics/Camera.hpp
some code reorganization
[blank.git] / src / graphics / Camera.hpp
1 #ifndef BLANK_GRAPHICS_CAMERA_HPP_
2 #define BLANK_GRAPHICS_CAMERA_HPP_
3
4 #include <glm/glm.hpp>
5
6
7 namespace blank {
8
9 class Camera {
10
11 public:
12         Camera() noexcept;
13
14         void Viewport(int width, int height) noexcept;
15         void Viewport(int x, int y, int width, int height) noexcept;
16
17         /// FOV in radians
18         void FOV(float f) noexcept;
19         void Aspect(float r) noexcept;
20         void Aspect(float w, float h) noexcept;
21         void Clip(float near, float far) noexcept;
22
23         const glm::mat4 &Projection() noexcept { return projection; }
24
25 private:
26         void UpdateProjection() noexcept;
27
28 private:
29         float fov;
30         float aspect;
31         float near_clip;
32         float far_clip;
33
34         glm::mat4 projection;
35
36 };
37
38 }
39
40 #endif