Graphics/Particles: Add wrappers on functions controller/generator/renderer

Former-commit-id: b4bc65fd61d304ab9c54f5eb960ee3ee111e4199 [formerly 6dc8ec4c126ec92253fcd1488f3d450a87cd2b0b] [formerly 72c62a62a1f34b633531c8e011e697a773ba574a [formerly d2aff554d20246c1fc5b47013e3e7c136c0b51a2]]
Former-commit-id: 54227b0f67e85ff186ec4ee7a3df0f3aa70193d1 [formerly 49065827d43b04e836901c05fee0542667c50683]
Former-commit-id: 013776ab4b91064bb48b18822317935376062a09
This commit is contained in:
Lynix
2016-08-14 17:54:37 +02:00
parent e0e0ed7379
commit c231d73f9e
9 changed files with 359 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/ParticleFunctionGenerator.hpp>
#include <memory>
#include <Nazara/Graphics/Debug.hpp>
namespace Nz
{
inline ParticleFunctionGenerator::ParticleFunctionGenerator(Generator generator) :
m_generator(std::move(generator))
{
}
/*!
* \brief Gets the generator function
*
* \return Generator function responsible for particle creation
*/
inline const ParticleFunctionGenerator::Generator& ParticleFunctionGenerator::GetGenerator() const
{
return m_generator;
}
/*!
* \brief Sets the generator function
*
* \remark The generator function must be valid
*/
inline void ParticleFunctionGenerator::SetGenerator(Generator generator)
{
m_generator = std::move(generator);
}
template<typename... Args>
ParticleFunctionGeneratorRef ParticleFunctionGenerator::New(Args&&... args)
{
std::unique_ptr<ParticleFunctionGenerator> object(new ParticleFunctionGenerator(std::forward<Args>(args)...));
object->SetPersistent(false);
return object.release();
}
}
#include <Nazara/Graphics/DebugOff.hpp>