summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kurator/src/Session.cpp11
-rw-r--r--kurator/src/Session.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/kurator/src/Session.cpp b/kurator/src/Session.cpp
index 59adcae..4333a53 100644
--- a/kurator/src/Session.cpp
+++ b/kurator/src/Session.cpp
@@ -13,6 +13,13 @@ namespace kurator
{
+std::shared_ptr<Scene>
+Session::current() const
+{
+ return scenes.back();
+}
+
+
void
Session::set(std::shared_ptr<Scene> scene)
{
@@ -42,11 +49,11 @@ void
Session::run()
{
while (!window.should_close() && !scenes.empty()) {
- auto scene = scenes.back();
+ auto scene = current();
rlImGuiBegin();
scene->update(GetFrameTime());
if (!scenes.empty())
- scene = scenes.back();
+ scene = current();
BeginDrawing();
scene->draw();
rlImGuiEnd();
diff --git a/kurator/src/Session.h b/kurator/src/Session.h
index dfc49e0..24f6f30 100644
--- a/kurator/src/Session.h
+++ b/kurator/src/Session.h
@@ -14,6 +14,7 @@ namespace kurator
class Session
{
public:
+ std::shared_ptr<Scene> current() const;
void set(std::shared_ptr<Scene> scene);
void push(std::shared_ptr<Scene> scene);
void pop();