diff --git a/base/camera.hpp b/base/camera.hpp index dfbc6549..97a8824b 100644 --- a/base/camera.hpp +++ b/base/camera.hpp @@ -37,6 +37,8 @@ private: { matrices.view = transM * rotM; } + + updated = true; }; public: enum CameraType { lookat, firstperson }; @@ -48,6 +50,8 @@ public: float rotationSpeed = 1.0f; float movementSpeed = 1.0f; + bool updated = false; + struct { glm::mat4 perspective; @@ -120,6 +124,7 @@ public: void update(float deltaTime) { + updated = false; if (type == CameraType::firstperson) { if (moving()) diff --git a/base/vulkanexamplebase.h b/base/vulkanexamplebase.h index f461bb9c..5680fb74 100644 --- a/base/vulkanexamplebase.h +++ b/base/vulkanexamplebase.h @@ -59,7 +59,7 @@ private: float fpsTimer = 0.0f; // Get window title with example name, device, et. std::string getWindowTitle(); - /** brief Indicates that the view (position, rotation) has changed and */ + /** brief Indicates that the view (position, rotation) has changed and buffers containing camera matrices need to be updated */ bool viewUpdated = false; // Destination dimensions for resizing the window uint32_t destWidth;