]> git.localhorst.tv Git - blank.git/blob - src/graphics/Canvas.hpp
a9ce7f55a0d15823847d120ae136d893d92b7fdb
[blank.git] / src / graphics / Canvas.hpp
1 #ifndef BLANK_GRAPHICS_CANVAS_HPP_
2 #define BLANK_GRAPHICS_CANVAS_HPP_
3
4 #include <glm/glm.hpp>
5
6
7 namespace blank {
8
9 class Canvas {
10
11 public:
12         Canvas() noexcept;
13
14         void Resize(float w, float h) noexcept;
15
16         const glm::vec2 &Offset() const noexcept { return offset; }
17         const glm::vec2 &Size() const noexcept { return size; }
18
19         const glm::mat4 &Projection() const noexcept { return projection; }
20         const glm::mat4 &View() const noexcept { return view; }
21
22 private:
23         void UpdateProjection() noexcept;
24
25 private:
26         glm::vec2 offset;
27         glm::vec2 size;
28         float near;
29         float far;
30
31         glm::mat4 projection;
32         glm::mat4 view;
33
34 };
35
36 }
37
38 #endif