Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
ParticleFunctionRenderer.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_PARTICLEFUNCTIONRENDERER_HPP
8 #define NAZARA_PARTICLEFUNCTIONRENDERER_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Graphics/ParticleRenderer.hpp>
12 #include <functional>
13 
14 namespace Nz
15 {
16  class ParticleFunctionRenderer;
17 
18  using ParticleFunctionRendererConstRef = ObjectRef<const ParticleFunctionRenderer>;
19  using ParticleFunctionRendererRef = ObjectRef<ParticleFunctionRenderer>;
20 
21  class NAZARA_GRAPHICS_API ParticleFunctionRenderer : public ParticleRenderer
22  {
23  public:
24  using Renderer = std::function<void(const ParticleGroup& /*group*/, const ParticleMapper& /*mapper*/, unsigned int /*startId*/, unsigned int /*endId*/, AbstractRenderQueue* /*renderQueue*/)>;
25 
26  inline ParticleFunctionRenderer(Renderer renderer);
28  ~ParticleFunctionRenderer() = default;
29 
30  void Render(const ParticleGroup& group, const ParticleMapper& mapper, unsigned int startId, unsigned int endId, AbstractRenderQueue* renderQueue) override final;
31 
32  inline const Renderer& GetRenderer() const;
33 
34  inline void SetRenderer(Renderer renderer);
35 
36  template<typename... Args> static ParticleFunctionRendererRef New(Args&&... args);
37 
38  private:
39  Renderer m_renderer;
40  };
41 }
42 
43 #include <Nazara/Graphics/ParticleFunctionRenderer.inl>
44 
45 #endif // NAZARA_PARTICLEFUNCTIONRENDERER_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Helper class used to provide a function as a particle renderer without going in the process of making...
Definition: ParticleFunctionRenderer.hpp:21
Graphics class that represents the mapping between the internal buffer and the particle declaration...
Definition: ParticleMapper.hpp:17
Graphics class that represents the rendering queue for our scene.
Definition: AbstractRenderQueue.hpp:26
Core class that represents a reference to an object.
Definition: ObjectRef.hpp:18
Graphics class that represents the rendering of the particle.
Definition: ParticleRenderer.hpp:28