Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
Public Member Functions | Public Attributes | List of all members
gf::GameManager Struct Reference

A game manager. More...

#include <gf/GameManager.h>

Inheritance diagram for gf::GameManager:
Inheritance graph
[legend]

Public Member Functions

 GameManager (const std::string &title, std::initializer_list< gf::Path > resourcePaths)
 
- Public Member Functions inherited from gf::SceneManager
 SceneManager (const std::string &title, Vector2i size, Flags< WindowHints > hints=All)
 Constructor. More...
 
void run (const RenderStates &states=RenderStates())
 Run the scene manager until completion. More...
 
void pushScene (Scene &scene)
 Add a scene on top of the stack. More...
 
void pushScenes (Span< const Ref< Scene > > scenes)
 Add multiple scenes on top of the stack. More...
 
void popScene ()
 Remove the top scene from the non-empty stack. More...
 
void popAllScenes ()
 Remove all the scenes from the non-empty stack. More...
 
void replaceScene (Scene &scene)
 Replace the top scene with a new scene. More...
 
void replaceScene (Span< const Ref< Scene > > scenes)
 Replace the top scene with many scenes. More...
 
void replaceAllScenes (Scene &scene)
 Replace all the scenes with a new scene. More...
 
void replaceAllScenes (Span< const Ref< Scene > > scenes)
 Replace all the scenes with many scenes. More...
 
void replaceScene (Scene &scene, SegueEffect &effect, Time duration, Easing easing=Ease::linear)
 Replace the top scene with a new scene and a transition. More...
 
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. More...
 
void replaceAllScenes (Scene &scene, SegueEffect &effect, Time duration, Easing easing=Ease::linear)
 Replace all the scenes with a new scene and a transition. More...
 
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. More...
 
WindowgetWindow ()
 Get the window associated to the scene. More...
 
RenderTargetgetRenderer ()
 Get the renderer associated to the scene. More...
 
Vector2f computeWindowToGameCoordinates (Vector2i coords, const View &view) const
 Get the game coordinates from the window coordinates. More...
 
Vector2i computeGameToWindowCoordinates (Vector2f coords, const View &view) const
 Get the window coordinates from the game coordinates. More...
 

Public Attributes

Random random
 
ResourceManager resources
 
MessageManager messages
 
GamepadTracker gamepads
 

Detailed Description

A game manager.

A game manager is a scene manager with additionals features that are common to many games.

See also
gf::SceneManager

Constructor & Destructor Documentation

◆ GameManager()

gf::GameManager::GameManager ( const std::string &  title,
std::initializer_list< gf::Path resourcePaths 
)

Member Data Documentation

◆ gamepads

GamepadTracker gf::GameManager::gamepads

◆ messages

MessageManager gf::GameManager::messages

◆ random

Random gf::GameManager::random

◆ resources

ResourceManager gf::GameManager::resources