JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Scene.hpp
Go to the documentation of this file.
1// Copyright 2025 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
5#pragma once
6
7#include "work.hpp"
8
9namespace jngl {
10
13using Scene = Work;
14
17
19template <class T, class... Args>
20T& setScene(Args&&... args) {
21 auto shared = std::make_shared<T>(std::forward<Args>(args)...);
22 auto& rtn = *shared;
23 setScene(std::move(shared));
24 return rtn;
25}
26
27} // namespace jngl
Active state of the game, e.g. a menu or the game itself.
Definition work.hpp:13
JNGL's main namespace.
void setScene(std::shared_ptr< Scene >)
Sets the passed Scene to be active in the main loop.