]> git.localhorst.tv Git - tacos.git/blob - src/graphics/viewport.hpp
ray/floor intersection experiments
[tacos.git] / src / graphics / viewport.hpp
1 #ifndef TACOS_GRAPHICS_VIEWPORT_HPP_
2 #define TACOS_GRAPHICS_VIEWPORT_HPP_
3
4 #include <glm/glm.hpp>
5
6
7 namespace tacos {
8
9 class Viewport {
10
11 public:
12         Viewport(int width, int height);
13
14         Viewport(const Viewport &) = delete;
15         Viewport &operator =(const Viewport &) = delete;
16
17         void Resize(int w, int h) noexcept;
18
19         int Width() const noexcept { return width; }
20         int Height() const noexcept { return height; }
21         glm::vec2 InverseSize() const noexcept { return inverse_size; }
22
23         const glm::mat4 &Perspective() const noexcept { return perspective; }
24         const glm::mat4 &Ortho() const noexcept { return ortho; }
25
26 private:
27         int width;
28         int height;
29         glm::vec2 inverse_size;
30
31         float fov;
32         float aspect;
33         float near;
34         float far;
35
36         glm::mat4 perspective;
37         glm::mat4 ortho;
38
39 };
40
41 }
42
43 #endif