![]() |
Middle Europe Productions Library
alpha 1.3.3
|
A basic class for the Application. More...
#include <Application.h>
Public Member Functions | |
| Application (const char *title, const char *resPath, const sf::Vector2u &mainResolution={ 1280, 720 }, U_int32 style=sf::Style::Default, sf::ContextSettings settings=sf::ContextSettings()) | |
| virtual | ~Application () |
| void | setWindowTransparent () |
| void | setWindowTransparency (unsigned char alpha) |
| void | initApp () |
| virtual bool | run () |
| virtual void | createResources ()=0 |
| virtual void | createWindows ()=0 |
Public Member Functions inherited from MEP::WindowData | |
| WindowData (const char *title, const sf::Vector2u &mainResolution={ 1280, 720 }, U_int32 style=sf::Style::Default, sf::ContextSettings settings=sf::ContextSettings()) | |
| void | initWindow () |
| sf::RenderWindow & | getRenderWindow () |
| sf::ContextSettings & | getContext () |
| sf::View & | getMepView () |
| void | changeResolution (const sf::Vector2u &newRes) |
| const sf::Vector2u & | getLaunchResolution () const |
| const sf::Vector2u | getWindowSize () const |
| void | setResolution (const sf::Vector2u &res) |
| sf::Vector2u | getResolution () const |
Public Member Functions inherited from MEP::Resources | |
| Resources (const std::string &path) | |
| template<typename ... Values> | |
| void | initResources (Values &&... values) |
| bool | isLoaded () const |
| Object & | getObject (const U_int32 ID, const U_int32 group=-1) |
| sf::Font & | getFont (const U_int32 ID, const U_int32 group=-1) |
| template<typename T > | |
| T & | get (const U_int32 ID, const U_int32 group=-1) |
| void | deleteObject (const U_int32 ID, const U_int32 group=-1) |
| void | deleteObjectsGroup (const U_int32 group) |
| void | deleteFont (const U_int32 ID, const U_int32 group=-1) |
| void | deleteFontGroup (const U_int32 group) |
| virtual | ~Resources () |
Public Member Functions inherited from MEP::WindowStats | |
| WindowStats ()=default | |
| void | updateStatistics (sf::Time dt) |
| unsigned int | getFrameRate () const |
| sf::Time & | getGlobalTime () |
| ~WindowStats ()=default | |
Public Member Functions inherited from MEP::BaseManager | |
| BaseManager ()=default | |
| BaseWindow & | getWindow (MEP::U_int32 ID, MEP::U_int32 group=-1) |
| std::map< MEP::U_int32, std::shared_ptr< BaseWindow > > & | getWindowGroup (MEP::U_int32 group=-1) |
| void | deleteWindow (MEP::U_int32 ID, MEP::U_int32 group=-1) |
| void | deleteWindowGroup (MEP::U_int32 group=-1) |
| void | addWindow (BaseWindow *window, MEP::U_int32 group=-1) |
| BaseWindow & | latestWindow () |
| template<typename Method > | |
| void | execute (Method method) |
| template<typename Method > | |
| void | execute (Method method, MEP::U_int32 group) |
Protected Member Functions | |
| virtual void | update () |
| virtual void | handleEvents () |
| virtual void | render () |
| virtual void | onResize () |
Protected Member Functions inherited from MEP::NonCopyable | |
| NonCopyable ()=default | |
| ~NonCopyable ()=default | |
Protected Attributes | |
| bool | isInit = false |
Protected Attributes inherited from MEP::WindowData | |
| sf::View | m_view |
| sf::Vector2u | m_resolution |
| const sf::Vector2u | m_launchResolution |
| sf::ContextSettings | m_settings |
| sf::Color | m_backgroundColor = sf::Color::Black |
| std::string | m_title |
| U_int32 | m_style |
A basic class for the Application.
MEP::Window::Teample::Application features: Window management. Resource management. Exceptions management. Main loop management. Inheriting this class u are able to generate a fully functional application window.
|
inline |
Base constructor for the Application.
| [in] | title | : Title of the window. |
| [in] | resPath | : Path to the resorces. |
| [in] | mainResolution | : Resolution of the window. |
| [in] | style | : Style of a window. Use sf::Style here. |
| [in] | settings | : Have a look on sf::ContextSettings for the information. |
|
inlinevirtual |
|
pure virtual |
Creates the game resources. Method needs to be overwritten
|
pure virtual |
Creates the game resources. Method needs to be overwritten
|
inlineprotectedvirtual |
Main update events method, all of the imputs to the program are analyzed here. The update method in executed only for MEP::Window::BaseWindow with a status == BaseWindow::Status::Main furthermore, the individual imput will be handled separately for all of the BaseWindow::Status::Main windows.
|
inline |
Initialization of an Application Two methods are executed: createResources() createWindows() (in the following order) The method can throw a MEP::Window::WindowException exception if something is not right inside of the aforementioned methods.
|
inlineprotectedvirtual |
Overrides the on resize method. A little hint is that SFML only executes this method when actual size of the window was changed so you dont need to check that.
Reimplemented from MEP::WindowData.
|
inlineprotectedvirtual |
Main render method, all of the drawing are done here. Method is supporting custom views from the MEP::Window::BaseWindow and it renders all of the MEP::Window::BaseWindow with a status == BaseWindow::Status::Main
|
inlinevirtual |
Main loop. Just use it to run an application. The method can throw a MEP::Window::WindowException.
|
inline |
Method changes the transparency level up to 255 of a window. It is a PLATFORM dependent method.
|
inline |
Method sets the sf::Color::Transparent to a real transparent color. It is a PLATFORM dependent method.
|
inlineprotectedvirtual |
Main update method, all of the program logic is executed here. The update method in executed only for MEP::Window::BaseWindow with a status != BaseWindow::Status::NullAction
|
protected |
Status of an initialization.