From b06608638c7ef3e7500e5db12ce0f4102c1cf376 Mon Sep 17 00:00:00 2001
From: Josh Morgenstern <josh@morgenstern.dev>
Date: Tue, 15 Jun 2021 00:13:32 +0200
Subject: [PATCH] [#42] remove camera & window from controller

---
 .../include/vkcv/camera/CameraController.hpp  | 33 +++----------------
 1 file changed, 5 insertions(+), 28 deletions(-)

diff --git a/modules/camera/include/vkcv/camera/CameraController.hpp b/modules/camera/include/vkcv/camera/CameraController.hpp
index 0f5cf612..f8a1ea0e 100644
--- a/modules/camera/include/vkcv/camera/CameraController.hpp
+++ b/modules/camera/include/vkcv/camera/CameraController.hpp
@@ -10,11 +10,6 @@ namespace vkcv {
      * #PilotCameraController.
      */
     class CameraController {
-    protected:
-        Camera* m_camera;
-        Window* m_window;
-        double m_lastX;
-        double m_lastY;
 
     public:
 
@@ -23,29 +18,11 @@ namespace vkcv {
          */
         CameraController() = default;
 
-        /**
-         * @brief Gets the camera object.
-         * @return The camera object.
-         */
-        Camera& getCamera();
-
-        /**
-         * @brief Sets @p camera as the new camera object.
-         * @param camera The new camera object.
-         */
-        virtual void setCamera(Camera &camera);
-
-        /**
-         * @brief Sets @p window as the new window object.
-         * @param window The new window object.
-         */
-        void setWindow(Window &window);
-
         /**
          * @brief Updates the camera object in respect to @p deltaTime.
          * @param deltaTime The time that has passed since last update.
          */
-        virtual void updateCamera(double deltaTime);
+        virtual void updateCamera(double deltaTime, Camera &camera);
 
         /**
          * @brief A callback function for key events.
@@ -54,21 +31,21 @@ namespace vkcv {
          * @param[in] action The key action.
          * @param[in] mods The modifier bits.
          */
-        virtual void keyCallback(int key, int scancode, int action, int mods);
+        virtual void keyCallback(int key, int scancode, int action, int mods, Camera &camera);
 
         /**
          * @brief A callback function for mouse scrolling events.
          * @param[in] offsetX The offset in horizontal direction.
          * @param[in] offsetY The offset in vertical direction.
          */
-        virtual void scrollCallback( double offsetX, double offsetY);
+        virtual void scrollCallback( double offsetX, double offsetY, Camera &camera);
 
         /**
          * @brief A callback function for mouse movement events.
          * @param[in] x The horizontal mouse position.
          * @param[in] y The vertical mouse position.
          */
-        virtual void mouseMoveCallback(double offsetX, double offsetY);
+        virtual void mouseMoveCallback(double offsetX, double offsetY, Camera &camera);
 
         /**
          * @brief A callback function for mouse button events.
@@ -76,7 +53,7 @@ namespace vkcv {
          * @param[in] action The button action.
          * @param[in] mods The modifier bits.
          */
-        virtual void mouseButtonCallback(int button, int action, int mods);
+        virtual void mouseButtonCallback(int button, int action, int mods, Camera &camera);
     };
 
 }
\ No newline at end of file
-- 
GitLab