From a2cc45117d3a8ea89508568c98ee3e618fad5d53 Mon Sep 17 00:00:00 2001 From: Elias Almqvist Date: Mon, 7 Nov 2022 15:02:58 +0100 Subject: [PATCH] Controller boilerplate --- headers/controller.hpp | 12 ++++++++++++ headers/renderer.hpp | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 headers/controller.hpp diff --git a/headers/controller.hpp b/headers/controller.hpp new file mode 100644 index 0000000..92923fc --- /dev/null +++ b/headers/controller.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include "renderer.hpp" +#include "GLFW/glfw3.h" + +class Controller { + Controller(GLFWwindow* win); + Controller(GLFWwindow* win, Renderer::Camera cam); + + protected: + Renderer::Camera cam; +}; diff --git a/headers/renderer.hpp b/headers/renderer.hpp index c83ac7b..0a4ecf3 100644 --- a/headers/renderer.hpp +++ b/headers/renderer.hpp @@ -48,11 +48,11 @@ namespace Renderer { }; class Camera : public Object { - public: - Camera(GLFWwindow* win); - Camera(GLFWwindow* win, glm::vec3 pos); - Camera(GLFWwindow* win, glm::vec3 pos, glm::vec3 angle); + Camera(GLFWwindow* win); + Camera(GLFWwindow* win, glm::vec3 pos); + Camera(GLFWwindow* win, glm::vec3 pos, glm::vec3 angle); + public: void setFOV(float deg); void pointAt(glm::vec3 target);