JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
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
9
namespace
jngl
{
10
13
using
Scene
=
Work
;
14
16
void
setScene
(
std::shared_ptr<Scene>
);
17
19
template
<
class
T,
class
... Args>
20
T&
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
jngl::Work
Active state of the game, e.g. a menu or the game itself.
Definition
work.hpp:13
std::function
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10
jngl::setScene
void setScene(std::shared_ptr< Scene >)
Sets the passed Scene to be active in the main loop.
work.hpp