]> git.localhorst.tv Git - tacos.git/blobdiff - src/graphics/viewport.hpp
basic floor idea
[tacos.git] / src / graphics / viewport.hpp
diff --git a/src/graphics/viewport.hpp b/src/graphics/viewport.hpp
new file mode 100644 (file)
index 0000000..cc9a100
--- /dev/null
@@ -0,0 +1,41 @@
+#ifndef TACOS_GRAPHICS_VIEWPORT_HPP_
+#define TACOS_GRAPHICS_VIEWPORT_HPP_
+
+#include <glm/glm.hpp>
+
+
+namespace tacos {
+
+class Viewport {
+
+public:
+       Viewport(int width, int height);
+
+       Viewport(const Viewport &) = delete;
+       Viewport &operator =(const Viewport &) = delete;
+
+       void Resize(int w, int h) noexcept;
+
+       int Width() const noexcept { return width; }
+       int Height() const noexcept { return height; }
+
+       const glm::mat4 &Perspective() const noexcept { return perspective; }
+       const glm::mat4 &Ortho() const noexcept { return ortho; }
+
+private:
+       int width;
+       int height;
+
+       float fov;
+       float aspect;
+       float near;
+       float far;
+
+       glm::mat4 perspective;
+       glm::mat4 ortho;
+
+};
+
+}
+
+#endif