OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
configframelistener.h
1 /*
2  Copyright (C) 2014 - 2016 Mutzii
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 */
18 #ifndef CONFIGFRAMELISTENER_H
19 #define CONFIGFRAMELISTENER_H
20 
21 #include "index.h"
22 #include "input.h"
23 #include "rendermanager.h"
24 #include "factory.h"
25 #include "overlayrendering.h"
26 #include "systemmanager.h"
27 #include "openpolygon.h"
28 #include "textelement.h"
29 #include "panelelement.h"
30 
31 namespace Engine
32 {
33 
34  using TextElements = std::list< TextElement * >;
35  using PanelElements = std::list< PanelElement * >;
36 
41 {
42  public:
43  explicit ConfigFrameListener( const std::string & config_file );
45 
46  /* Frame Listener */
47  void initialize( OpenPolygonDisplay * display );
48  void RenderLogic(float time);
49 
50  /* Input Listener */
51  void onKeyEvent(const KeyEvent &event);
52  void onMouseEvent(const MouseEvent &event);
53 
54  protected:
55 
56  void createOverlay(void);
57 
58  void createSystem( OpenPolygonDisplay * display );
59 
60  void ShowFPS( float time );
61 
62  void DestroyWindow( const KeyEvent & event );
63 
64  /* Create Mouse - Panel Events */
65  void MousePanelCollision(void);
66 
67  private:
68 
69  OpenPolygonDisplay * m_display;
70 
71  std::string m_config_file;
72 
73  TextElement * m_fps;
74  TextElement * m_button_text;
75 
76  Texture * m_button_red01;
77  Texture * m_button_red02;
78  Texture * m_button_red03;
79 
80  PanelElement * m_mouse_panel;
81 
82  TextElements m_text_elements;
83  PanelElements m_panel_elements;
84 
85  PanelElements m_panel_collision;
86 
87  ObjectBox m_mouse;
88  ObjectBox m_custom;
89 
90  int m_mouse_click;
91 };
92 
93 
94 }
95 
96 #endif // CONFIGFRAMELISTENER_H
The Texture class.
Definition: texture.h:37
Definition: element.h:23
void onMouseEvent(const MouseEvent &event)
onMouseEvent
Definition: ConfigFrameListener.cpp:62
The FrameListener - Interface class.
Definition: framelistener.h:29
The InputListener - Interface class.
Definition: input.h:97
void onKeyEvent(const KeyEvent &event)
onKeyEvent
Definition: ConfigFrameListener.cpp:57
Definition: eutils.h:53
The KeyEvent - Event class.
Definition: input.h:64
The PanelElement - Panel Objective class.
Definition: panelelement.h:35
The MouseEvent - Event class.
Definition: input.h:31
void RenderLogic(float time)
RenderLogic.
Definition: ConfigFrameListener.cpp:42
The TextElement - Text Objective class.
Definition: textelement.h:57
The OpenPolygonDisplay - display abstract class.
Definition: display.h:55
void initialize(OpenPolygonDisplay *display)
initialize
Definition: ConfigFrameListener.cpp:33
The ConfigFrameListener class.
Definition: configframelistener.h:40