OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
panelelement.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 PANELELEMENT_H
19 #define PANELELEMENT_H
20 
21 #include "index.h"
22 #include "displaymanager.h"
23 #include "rendercomponent.h"
24 #include "elementmanager.h"
25 #include "shadermanager.h"
26 #include "positionmanager.h"
27 #include "meshmanager.h"
28 #include "embedded_resource.h"
29 
30 namespace Engine
31 {
35  class PanelElement : public RenderElement
36  {
37  public:
38  enum PanelMode
39  {
40  PM_COLOUR ,
41  PM_TEXTURE
42  };
43 
44  explicit PanelElement( PanelMode mode );
45  ~PanelElement(void);
46 
47  void create( OpenPolygonDisplay * display );
48  void draw(const DrawEvent &event);
49 
50  void setPosition( const Vector3f & position );
51  void setScale( const Vector3f & scale );
52  void setColour( const Vector4f & colour );
53  void setTexture( Texture * texture );
54  void setSize(const Vector2f & size );
55  void setVisible( bool status );
56 
57  bool isVisible(void);
58  Vector2f getSize(void);
59  Vector3f getAbsolutePosition(void);
60 
61  protected:
62 
63  void DrawColourMode( const DrawEvent & event );
64  void DrawTextureMode( const DrawEvent & event );
65 
66  private:
67 
68  Element * m_element;
69  Mesh * m_mesh;
70  Position * m_position;
71  IShader * m_shader;
72  Texture * m_texture;
73 
74  OpenPolygonDisplay * m_display;
75 
76  PanelMode m_mode;
77  Vector4f m_colour;
78  Vector2f m_size;
79  Vector3f m_abs_position;
80 
81  bool m_visible;
82  };
83 
84 }
85 
86 #endif // PANELELEMENT_H
The Texture class.
Definition: texture.h:37
Definition: element.h:23
The IShader - abstract / interface class.
Definition: IShader.h:30
The DrawEvent - event class.
Definition: drawevent.h:31
The PanelElement - Panel Objective class.
Definition: panelelement.h:35
The Mesh class.
Definition: mesh.h:32
The RenderElement - contained component Element - abstract class.
Definition: rendercomponent.h:103
The Element - base component class - for 2D Entitys.
Definition: element.h:28
The OpenPolygonDisplay - display abstract class.
Definition: display.h:55
The Position class.
Definition: position.h:29