diff --git a/applications/gui/src/camera.cpp b/applications/gui/src/camera.cpp index a6f578179789ec079e2f58722257b645e30dccbf..a541d910d9031df9d305cff9ded337f776bcc1e1 100644 --- a/applications/gui/src/camera.cpp +++ b/applications/gui/src/camera.cpp @@ -576,6 +576,16 @@ bool ftl::gui::Camera::thumbnail(cv::Mat &thumb) { return true; } +void ftl::gui::Camera::active(bool a) { + if (a) { + + } else { + neye_[0] = eye_[0]; + neye_[1] = eye_[1]; + neye_[2] = eye_[2]; + } +} + const GLTexture &ftl::gui::Camera::captureFrame() { float now = (float)glfwGetTime(); delta_ = now - ftime_; diff --git a/applications/gui/src/camera.hpp b/applications/gui/src/camera.hpp index b92f241541c7af9e8a2f284eab6cf60cdf55bf56..fd4f91d5aafcd928c977613241e7b20eb7a067db 100644 --- a/applications/gui/src/camera.hpp +++ b/applications/gui/src/camera.hpp @@ -66,6 +66,11 @@ class Camera { void draw(std::vector<ftl::rgbd::FrameSet*> &fss); + /** + * @internal. Used to inform the camera if it is the active camera or not. + */ + void active(bool); + const GLTexture &captureFrame(); const GLTexture &getLeft() const { return texture1_; } const GLTexture &getRight() const { return texture2_; } diff --git a/applications/gui/src/screen.cpp b/applications/gui/src/screen.cpp index 70a79163b4a8ab7716df5bfbcf1846805301e962..2d2274058087c0f3b5bd1f6d6f876e798b3ed05b 100644 --- a/applications/gui/src/screen.cpp +++ b/applications/gui/src/screen.cpp @@ -360,6 +360,7 @@ ftl::gui::Screen::~Screen() { } void ftl::gui::Screen::setActiveCamera(ftl::gui::Camera *cam) { + if (camera_) camera_->active(false); camera_ = cam; if (cam) { @@ -367,6 +368,7 @@ void ftl::gui::Screen::setActiveCamera(ftl::gui::Camera *cam) { mwindow_->setVisible(true); mwindow_->cameraChanged(); swindow_->setVisible(false); + cam->active(true); } else { mwindow_->setVisible(false); swindow_->setVisible(true);