OpenPolygon  1.0.0
OpenPolygon is a Rendering Engine
particleeffectmanager.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 PARTICLEEFFECTMANAGER_H
19 #define PARTICLEEFFECTMANAGER_H
20 
21 #include "index.h"
22 #include "meshmanager.h"
23 #include "texturebufferobject.h"
24 #include "particleeffect.h"
25 #include "drawevent.h"
26 #include "rendercomponent.h"
27 #include "scenemanager.h"
28 #include "display.h"
29 
30 namespace Engine
31 {
32 
33  using ParticleEffects = std::list< ParticleEffect * >;
34 
36 {
37  public:
38  explicit ParticleEffectManager( OpenPolygonDisplay * display );
39  ~ParticleEffectManager(void)=default;
40 
41  void create( OpenPolygonDisplay * display );
42  void draw( const DrawEvent & event );
43 
44  void initialize(void);
45  void initialize( const std::string & mesh_name );
46  void initialize( Mesh * mesh );
47 
48  void addEffect( ParticleEffect * effect , int particle_count );
49 
50  void render( const std::string & effect_name , const DrawEvent & event );
51  void render( ParticleEffect * effect , const DrawEvent & event );
52 
53  bool isInitialized(void);
54 
55  ParticleEffect * getEffect( const std::string & effect_name );
56 
57  void remove( ParticleEffect * effect );
58  void remove( const std::string & effect_name );
59 
60  ParticleEffects getEffects(void);
61 
62  private:
63 
64  bool m_initialize;
65  int m_index_size;
66 
67  GLVertexArrayObject * m_particle_vao;
68  GLVertexBuffer * m_vertex_buffer;
69  GLElementBuffer * m_index_buffer;
70 
71  IShader * m_particle_shader;
72  TextureBufferObject * m_particle_tbo;
73 
74  ParticleEffects m_effects;
75 
76 };
77 
78 }
79 
80 #endif // PARTICLEEFFECTMANAGER_H
The RenderEntity - contained component Entity - abstract class.
Definition: rendercomponent.h:45
Definition: element.h:23
The GLVertexBuffer class.
Definition: glvertexbuffer.h:30
The IShader - abstract / interface class.
Definition: IShader.h:30
The GLElementBuffer class.
Definition: glelementbuffer.h:29
The DrawEvent - event class.
Definition: drawevent.h:31
The TextureBufferObject class.
Definition: texturebufferobject.h:35
The ParticleEffect - abstract class.
Definition: particleeffect.h:57
The Mesh class.
Definition: mesh.h:32
Definition: particleeffectmanager.h:35
The OpenPolygonDisplay - display abstract class.
Definition: display.h:55
The GLVertexArrayObject class.
Definition: glvertexarrayobject.h:60