summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kurator/src/Session.cpp9
-rw-r--r--kurator/src/Session.h2
2 files changed, 10 insertions, 1 deletions
diff --git a/kurator/src/Session.cpp b/kurator/src/Session.cpp
index 4f8e8e2..0d55eb3 100644
--- a/kurator/src/Session.cpp
+++ b/kurator/src/Session.cpp
@@ -22,7 +22,7 @@ Session::set(std::shared_ptr<Scene> _scene)
void
Session::run()
{
- while (!window.should_close()) {
+ while (!window.should_close() && keep_going) {
if (!scene)
return;
rlImGuiBegin();
@@ -35,4 +35,11 @@ Session::run()
}
+void
+Session::quit()
+{
+ keep_going = false;
+}
+
+
} // namespace kurator
diff --git a/kurator/src/Session.h b/kurator/src/Session.h
index 43f5747..4bb55cf 100644
--- a/kurator/src/Session.h
+++ b/kurator/src/Session.h
@@ -15,7 +15,9 @@ class Session
public:
void set(std::shared_ptr<Scene> _scene);
void run();
+ void quit();
private:
+ bool keep_going = true;
Window window;
std::shared_ptr<Scene> scene;
};