Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
ParticleController.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Graphics module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_PARTICLECONTROLLER_HPP
8 #define NAZARA_PARTICLECONTROLLER_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/ObjectLibrary.hpp>
12 #include <Nazara/Core/ObjectRef.hpp>
13 #include <Nazara/Core/RefCounted.hpp>
14 #include <Nazara/Core/Signal.hpp>
15 #include <Nazara/Graphics/Config.hpp>
16 
17 namespace Nz
18 {
19  class ParticleController;
20  class ParticleMapper;
21  class ParticleGroup;
22 
23  using ParticleControllerConstRef = ObjectRef<const ParticleController>;
24  using ParticleControllerLibrary = ObjectLibrary<ParticleController>;
25  using ParticleControllerRef = ObjectRef<ParticleController>;
26 
27  class NAZARA_GRAPHICS_API ParticleController : public RefCounted
28  {
29  friend ParticleControllerLibrary;
30  friend class Graphics;
31 
32  public:
33  ParticleController() = default;
34  ParticleController(const ParticleController& controller);
35  virtual ~ParticleController();
36 
37  virtual void Apply(ParticleGroup& system, ParticleMapper& mapper, unsigned int startId, unsigned int endId, float elapsedTime) = 0;
38 
39  // Signals:
40  NazaraSignal(OnParticleControllerRelease, const ParticleController* /*particleController*/);
41 
42  private:
43  static bool Initialize();
44  static void Uninitialize();
45 
46  static ParticleControllerLibrary::LibraryMap s_library;
47  };
48 }
49 
50 #endif // NAZARA_PARTICLECONTROLLER_HPP
Graphics class which controls a flow of particles.
Definition: ParticleController.hpp:27
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the module initializer of Graphics.
Definition: Graphics.hpp:15
Graphics class that represents the mapping between the internal buffer and the particle declaration...
Definition: ParticleMapper.hpp:17
decltype(auto) Apply(F &&fn, Tuple &&t)
Applies the tuple to the function (e.g. calls the function using the tuple content as arguments) ...
Definition: Algorithm.inl:48
Core class that represents a reference with a counter.
Definition: RefCounted.hpp:21