OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
technique.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 TECHNIQUE_H
19 #define TECHNIQUE_H
20 
21 #include "index.h"
22 #include "rendersystem.h"
23 #include "framebuffer.h"
24 #include "texture.h"
25 #include "mesh.h"
26 #include "position.h"
27 #include "renderprocessmanager.h"
28 
29 namespace Engine
30 {
34  class Technique
35  {
36  public:
37  explicit Technique( const std::string & name )
38  : m_name( name ) ,
39  m_system( nullptr ) ,
40  m_fbo( nullptr ) ,
41  m_screen( nullptr ) ,
42  m_screen_position(nullptr),
43  m_active( false )
44  {}
45 
46  virtual ~Technique() = default;
47 
48  virtual void Create (void)=0;
49  virtual void Prepare(void)=0;
50  virtual void Update(void)=0;
51  virtual void Render( Texture * basic )=0;
52 
53  void setRenderModulManager( RenderModulManager * render_module_manager )
54  {
55  m_render_modul_manager = render_module_manager;
56  }
57 
58  void setScreenPosition( Position * position )
59  {
60  m_screen_position = position;
61  }
62 
63  void setScreen( Mesh * mesh )
64  {
65  m_screen = mesh;
66  }
67 
68  void setActiveSystem( RenderSystem * system )
69  {
70  m_system = system;
71  }
72 
73  void setFrameBuffer( FrameBuffer * fbo )
74  {
75  m_fbo = fbo;
76  }
77 
78  bool isActived(void)
79  {
80  return m_active;
81  }
82 
83  void setStatus( bool status )
84  {
85  m_active = status;
86  }
87 
88  std::string getName(void)
89  {
90  return m_name;
91  }
92 
93  FrameBuffer * getFrameBuffer(void)
94  {
95  return m_fbo;
96  }
97 
98  RenderModulManager * getRenderModulManager(void)
99  {
100  return m_render_modul_manager;
101  }
102 
103 
104  protected:
105 
106  std::string m_name;
107  RenderSystem * m_system;
108  FrameBuffer * m_fbo;
109  Mesh * m_screen;
110  Position * m_screen_position;
111  RenderModulManager * m_render_modul_manager;
112 
113  bool m_active;
114  };
115 }
116 
117 
118 #endif // TECHNIQUE_H
The Texture class.
Definition: texture.h:37
Definition: rendermodulmanager.h:14
Definition: element.h:23
The Technique - abstract / interface class.
Definition: technique.h:34
The Mesh class.
Definition: mesh.h:32
The RenderSystem - abstract / interface class.
Definition: rendersystem.h:41
The FrameBuffer class.
Definition: framebuffer.h:31
The Position class.
Definition: position.h:29