21#ifndef GF_SCENE_MANAGER_H
22#define GF_SCENE_MANAGER_H
30#include "GraphicsApi.h"
32#include "RenderStates.h"
33#include "RenderWindow.h"
34#include "RenderTexture.h"
37#include "SegueEffect.h"
42#ifndef DOXYGEN_SHOULD_SKIP_THIS
228 bool m_scenesChanged;
230 std::vector<Ref<Scene>> m_currScenes;
231 std::vector<Ref<Scene>> m_prevScenes;
246#ifndef DOXYGEN_SHOULD_SKIP_THIS
static float linear(float t)
Linear easing.
Bitfield relying on an enumeration.
Definition: Flags.h:48
A reference wrapper.
Definition: Ref.h:39
Base class for all render targets (window, texture, ...)
Definition: RenderTarget.h:102
Target for off-screen 2D rendering into a texture.
Definition: RenderTexture.h:98
A window that can serve as a target for 2D drawing.
Definition: RenderWindow.h:80
A scene in the game.
Definition: Scene.h:66
A scene manager.
Definition: SceneManager.h:61
void replaceScene(Span< const Ref< Scene > > scenes, SegueEffect &effect, Time duration, Easing easing=Ease::linear)
Replace the top scene with many scenes and a transition.
void pushScene(Scene &scene)
Add a scene on top of the stack.
void replaceAllScenes(Scene &scene, SegueEffect &effect, Time duration, Easing easing=Ease::linear)
Replace all the scenes with a new scene and a transition.
void popScene()
Remove the top scene from the non-empty stack.
void replaceAllScenes(Scene &scene)
Replace all the scenes with a new scene.
Definition: SceneManager.h:134
void replaceScene(Span< const Ref< Scene > > scenes)
Replace the top scene with many scenes.
Definition: SceneManager.h:122
Vector2f computeWindowToGameCoordinates(Vector2i coords, const View &view) const
Get the game coordinates from the window coordinates.
Vector2i computeGameToWindowCoordinates(Vector2f coords, const View &view) const
Get the window coordinates from the game coordinates.
SceneManager(const std::string &title, Vector2i size, Flags< WindowHints > hints=All)
Constructor.
void popAllScenes()
Remove all the scenes from the non-empty stack.
void replaceAllScenes(Span< const Ref< Scene > > scenes)
Replace all the scenes with many scenes.
Definition: SceneManager.h:146
Window & getWindow()
Get the window associated to the scene.
Definition: SceneManager.h:194
void replaceScene(Scene &scene, SegueEffect &effect, Time duration, Easing easing=Ease::linear)
Replace the top scene with a new scene and a transition.
virtual void doGlobalProcessEvent(const Event &event)
void pushScenes(Span< const Ref< Scene > > scenes)
Add multiple scenes on top of the stack.
void run(const RenderStates &states=RenderStates())
Run the scene manager until completion.
void replaceScene(Scene &scene)
Replace the top scene with a new scene.
Definition: SceneManager.h:110
RenderTarget & getRenderer()
Get the renderer associated to the scene.
Definition: SceneManager.h:201
void replaceAllScenes(Span< const Ref< Scene > > scenes, SegueEffect &effect, Time duration, Easing easing=Ease::linear)
Replace all the scenes with many scenes and a transition.
Screen view.
Definition: Views.h:354
A segue effect.
Definition: SegueEffect.h:38
A transition between two scenes.
Definition: Segue.h:45
A span.
Definition: Span.h:414
Represents a time value.
Definition: Time.h:65
2D camera that defines what region is shown on framebuffer
Definition: View.h:94
An OS window.
Definition: Window.h:97
float(*)(float) Easing
An easing function.
Definition: Easings.h:48
constexpr AllType All
Constant to represent "all".
Definition: Types.h:61
The namespace for gf classes.
Defines a system event and its parameters.
Definition: Event.h:224
Define the states used for drawing to a RenderTarget.
Definition: RenderStates.h:82