Middle Europe Productions Library  alpha 1.3.3
Public Member Functions | Protected Attributes | List of all members
MEP::WindowData Class Reference

Core information related to the SFML Window functionalities. As well as context settings. More...

#include <WindowData.h>

Inheritance diagram for MEP::WindowData:
MEP::Template::Application

Public Member Functions

 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
 
virtual void onResize ()
 

Protected Attributes

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
 

Detailed Description

Core information related to the SFML Window functionalities. As well as context settings.

Holds information about window. Avalible operations:
Window - main window.
m_view - main view port.
m_resolution - master resolution
m_settings - main context of a window.

Constructor & Destructor Documentation

◆ WindowData()

MEP::WindowData::WindowData ( const char *  title,
const sf::Vector2u &  mainResolution = { 1280, 720 },
U_int32  style = sf::Style::Default,
sf::ContextSettings  settings = sf::ContextSettings() 
)
inline

Member Function Documentation

◆ changeResolution()

void MEP::WindowData::changeResolution ( const sf::Vector2u &  newRes)
inline

Changes the resolution of a window.

Parameters
[in]newRes: sf::Vector2u

◆ getContext()

sf::ContextSettings& MEP::WindowData::getContext ( )
inline

Returns a reference to the sf::ContextSettings

◆ getLaunchResolution()

const sf::Vector2u& MEP::WindowData::getLaunchResolution ( ) const
inline

Outputs the lunch re

◆ getMepView()

sf::View& MEP::WindowData::getMepView ( )
inline

Returns a reference to the master sf::View

◆ getRenderWindow()

sf::RenderWindow& MEP::WindowData::getRenderWindow ( )
inline

Returns a reference to the sf::RenderWindow

◆ getResolution()

sf::Vector2u MEP::WindowData::getResolution ( ) const
inline

Output the current resolution of a window.

Returns
: sf::Vector2u.

◆ getWindowSize()

const sf::Vector2u MEP::WindowData::getWindowSize ( ) const
inline

Returns the actual size of a window if you are using MEP::Template::Hub size == resolution.

◆ initWindow()

void MEP::WindowData::initWindow ( )
inline

Creates the window.

◆ onResize()

virtual void MEP::WindowData::onResize ( )
inlinevirtual

A method from sf::Window.

Reimplemented in MEP::Template::Application.

◆ setResolution()

void MEP::WindowData::setResolution ( const sf::Vector2u &  res)
inline

Sets the resolution of a window. Warning setResolution does not update the resolution use updateResolution() if you want to commit changes.

Member Data Documentation

◆ m_backgroundColor

sf::Color MEP::WindowData::m_backgroundColor = sf::Color::Black
protected

Color of a background of the window.

◆ m_launchResolution

const sf::Vector2u MEP::WindowData::m_launchResolution
protected

Lunching resloution of the code.

◆ m_resolution

sf::Vector2u MEP::WindowData::m_resolution
protected

Resolution of a window.

◆ m_settings

sf::ContextSettings MEP::WindowData::m_settings
protected

Setting of a context. Antialiasing etc.

◆ m_style

U_int32 MEP::WindowData::m_style
protected

Style of the window.

◆ m_title

std::string MEP::WindowData::m_title
protected

Title of the window.

◆ m_view

sf::View MEP::WindowData::m_view
protected

Master view (can be changed in a MEP::Window::BaseWindow