From c0307be5ad0d8a53bbd4b21beba1d1baf12f7e22 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Sat, 22 Jun 2019 10:26:36 +0300
Subject: [PATCH] Space to pause in GUI

---
 applications/gui/src/main.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/applications/gui/src/main.cpp b/applications/gui/src/main.cpp
index dddcf3c90..c9a807b61 100644
--- a/applications/gui/src/main.cpp
+++ b/applications/gui/src/main.cpp
@@ -244,10 +244,14 @@ class FTLApplication : public nanogui::Screen {
 	explicit FTLApplication(ftl::Configurable *root, ftl::net::Universe *net, ftl::ctrl::Master *controller) : nanogui::Screen(Eigen::Vector2i(1024, 768), "FT-Lab GUI") {
 		using namespace nanogui;
 		net_ = net;
+		ctrl_ = controller;
 
 		cwindow_ = new ftl::gui::ControlWindow(this, controller);
 		swindow_ = new ftl::gui::SourceWindow(this, controller);
 
+		cwindow_->setPosition(Eigen::Vector2i(20, 20));
+		swindow_->setPosition(Eigen::Vector2i(20, 400));
+
 		//src_ = nullptr;
 		eye_ = Eigen::Vector3f(0.0f, 0.0f, 0.0f);
 		neye_ = Eigen::Vector4f(0.0f, 0.0f, 0.0f, 0.0f);
@@ -356,6 +360,8 @@ class FTLApplication : public nanogui::Screen {
 			} else if (action == 1 && key == 'H') {
 				swindow_->setVisible(!swindow_->visible());
 				cwindow_->setVisible(!cwindow_->visible());
+			} else if (action == 1 && key == 32) {
+				ctrl_->pause();
 			}
 			return false;
 		}
@@ -477,6 +483,7 @@ class FTLApplication : public nanogui::Screen {
 	float ftime_;
 	float delta_;
 	Eigen::Vector2f imageSize;
+	ftl::ctrl::Master *ctrl_;
 };
 
 int main(int argc, char **argv) {
-- 
GitLab