Robot Devastation
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
rd::SDLScreenManager Class Reference

Manage game screens using SDL libraries.

#include <SDLScreenManager.hpp>

Inheritance diagram for rd::SDLScreenManager:
rd::ScreenManager

Public Member Functions

virtual void setCurrentScreen (Screen *screen)
 Set a Screen as current Screen.
 
virtual bool show ()
 Display the current Screen on the game window.
 
virtual bool update (const std::string &parameter, const std::string &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const Image &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const Player &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const std::vector< Player > &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const std::vector< Target > &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const Weapon &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool configure (const std::string &parameter, const std::string &value)
 Configures a parameter with a value.
 
virtual bool start ()
 Start the ScreenManager. More...
 
virtual bool stop ()
 Stops the ScreenManager.
 
virtual bool isStopped () const
 True if the manager is not active.
 
virtual ~SDLScreenManager ()
 Destructor. Used to reset the local static reference after destroying this manager.
 

Static Public Member Functions

static bool initSDL ()
 SDL initialization.
 
static bool cleanupSDL ()
 SDL Cleanup.
 
static bool RegisterManager ()
 Register this manager in the ScreenManager registry so that can be used. More...
 
- Static Public Member Functions inherited from rd::ScreenManager
static ScreenManagergetScreenManager ()
 Get a reference to the ScreenManager. More...
 
static ScreenManagergetScreenManager (const std::string &id)
 Get a reference to the ScreenManager. More...
 
static bool destroyScreenManager ()
 Deallocate all the registered ScreenManager.
 

Static Public Attributes

static const std::string PARAM_FULLSCREEN = "fullscreen"
 
static const std::string id = "SDL"
 String that identifies this manager.
 

Private Member Functions

 SDLScreenManager ()
 Constructor. More...
 
 SDLScreenManager (const SDLScreenManager &)
 
SDLScreenManageroperator= (const SDLScreenManager &)
 

Private Attributes

bool stopped
 
bool sdl_initialized
 
bool fullscreen
 
SDL_Window * window
 
std::mutex mutex
 

Static Private Attributes

static SDLScreenManageruniqueInstance = NULL
 Stores the unique instance of the SDLScreenManager.
 

Additional Inherited Members

- Static Protected Member Functions inherited from rd::ScreenManager
static bool Register (ScreenManager *manager, const std::string &id)
 This function allows subclasses to install their unique instances in the singleton register to be selected later by the user.
 
- Protected Attributes inherited from rd::ScreenManager
Screenscreen
 

Constructor & Destructor Documentation

◆ SDLScreenManager()

rd::SDLScreenManager::SDLScreenManager ( )
private

Constructor for this class is private, since the singleton can only be instantiated once, and the instantiation is done at the RegisterManager() method

Member Function Documentation

◆ RegisterManager()

bool rd::SDLScreenManager::RegisterManager ( )
static

It ensures that only one manager of this type is created (unique instance)

◆ start()

bool rd::SDLScreenManager::start ( )
virtual

This function is supposed to be called after ScreenManager configuration.

Implements rd::ScreenManager.


The documentation for this class was generated from the following files: