2 #include "Viewport.hpp"
7 #include <glm/gtx/transform.hpp>
13 Camera::Camera() noexcept
18 , projection(glm::perspective(fov, aspect, near, far))
23 Camera::~Camera() noexcept {
26 void Camera::FOV(float f) noexcept {
31 void Camera::Aspect(float r) noexcept {
36 void Camera::Aspect(float w, float h) noexcept {
40 void Camera::Clip(float n, float f) noexcept {
46 void Camera::View(const glm::mat4 &v) noexcept {
50 void Camera::UpdateProjection() noexcept {
51 projection = glm::perspective(fov, aspect, near, far);
55 Viewport::Viewport(int w, int h)
59 glClearColor(0.0, 0.0, 0.0, 1.0);
62 Viewport::~Viewport() {
66 void Viewport::Resize(int w, int h) {
69 glViewport(0, 0, w, h);
72 void Viewport::Clear() {
73 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);