NRE_Application.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include "../NRE_System.hpp"
13  #include <Utility/Vector/NRE_Vector.hpp>
14 
19  namespace NRE {
24  namespace System {
25 
30  class Application {
31  private : // Fields
32  Graphics::Window& window;
33  Utility::Vector<Utility::Observer*> handlers;
35  public : // Methods
36  //## Constructor ##//
40  Application() = delete;
49  Application(Utility::String const& title, Math::Point2D<unsigned int> const& position, Math::Vector2D<unsigned int> const& size, unsigned int style, Graphics::ContextAttributes const& attr = Graphics::ContextAttributes());
57  Application(Utility::String const& title, Math::Vector2D<unsigned int> const& size, unsigned int style, Graphics::ContextAttributes const& attr = Graphics::ContextAttributes());
58 
59  //## Copy Constructor ##//
64  Application(Application const& app) = delete;
65 
66  //## Move Constructor ##//
71  Application(Application && app) = delete;
72 
73  //## Deconstructor ##//
77  virtual ~Application();
78 
79  //## Methods ##//
83  virtual void create() = 0;
87  virtual void update() = 0;
91  virtual void render() = 0;
95  virtual void destroy() = 0;
100  template <class T>
101  void addHandler(typename Event::EventHandler<T>::Handler && handler);
105  void NREmain();
106 
107  //## Assignment Operator ##//
113  Application& operator =(Application const& app) = delete;
119  Application& operator =(Application && app) = delete;
120 
121  };
122 
123  }
124  }
125 
126  #include "NRE_Application.tpp"
Manage a graphics window.
Definition: NRE_Window.hpp:34
Application & operator=(Application const &app)=delete
virtual void update()=0
virtual void render()=0
std::function< bool(T &)> Handler
Definition: NRE_EventHandler.hpp:35
Manage an user application.
Definition: NRE_Application.hpp:30
void addHandler(typename Event::EventHandler< T >::Handler &&handler)
virtual void create()=0
System&#39;s API.
The NearlyRealEngine&#39;s global namespace.
virtual void destroy()=0
Regroup all attributes needed in a GL context, should be modified before creation.
Definition: NRE_ContextAttributes.hpp:52