Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
ParticleMapper.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_PARTICLEMAPPER_HPP
8 #define NAZARA_PARTICLEMAPPER_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/SparsePtr.hpp>
12 #include <Nazara/Graphics/Enums.hpp>
13 #include <Nazara/Graphics/ParticleDeclaration.hpp>
14 
15 namespace Nz
16 {
17  class NAZARA_GRAPHICS_API ParticleMapper
18  {
19  public:
20  ParticleMapper(void* buffer, const ParticleDeclaration* declaration);
21  ~ParticleMapper();
22 
23  template<typename T> SparsePtr<T> GetComponentPtr(ParticleComponent component);
24  template<typename T> SparsePtr<const T> GetComponentPtr(ParticleComponent component) const;
25  inline void* GetPointer();
26 
27  private:
28  const ParticleDeclaration* m_declaration;
29  UInt8* m_ptr;
30  };
31 }
32 
33 #include <Nazara/Graphics/ParticleMapper.inl>
34 
35 #endif // NAZARA_PARTICLEMAPPER_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the mapping between the internal buffer and the particle declaration...
Definition: ParticleMapper.hpp:17
Core class that represents a pointer and the step between two elements.
Definition: SparsePtr.hpp:19
Graphics class that represents the declaration of the particle, works like an ECS.
Definition: ParticleDeclaration.hpp:28