Graphics/Particles: Add wrappers on functions controller/generator/renderer
Former-commit-id: 05ad40899814194286c3f038362a58d788dca0d5 [formerly c592befc3a534a67dfe0554fd7bde86a736bbb91] [formerly 42f3c9d1e1dc9575277f225da71e29430ac096c6 [formerly 62c0d364d496348c476d8b88168e14b2da17d778]] Former-commit-id: 8a4fa558e6bd09fbd55912f78dbb1bd0dcc2cb9d [formerly 94030181beae8c8d8dd4834e7373d470df8be56d] Former-commit-id: 967bbd78527ac1fce82ab692b3bd19dda20df9c2
This commit is contained in:
46
include/Nazara/Graphics/ParticleFunctionController.inl
Normal file
46
include/Nazara/Graphics/ParticleFunctionController.inl
Normal 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/ParticleFunctionController.hpp>
|
||||
#include <memory>
|
||||
#include <Nazara/Graphics/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline ParticleFunctionController::ParticleFunctionController(Controller controller) :
|
||||
m_controller(std::move(controller))
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the controller function
|
||||
*
|
||||
* \return Controller function responsible for particle update
|
||||
*/
|
||||
inline const ParticleFunctionController::Controller& ParticleFunctionController::GetController() const
|
||||
{
|
||||
return m_controller;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets the controller function
|
||||
*
|
||||
* \remark The controller function must be valid
|
||||
*/
|
||||
inline void ParticleFunctionController::SetController(Controller controller)
|
||||
{
|
||||
m_controller = std::move(controller);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
ParticleFunctionControllerRef ParticleFunctionController::New(Args&&... args)
|
||||
{
|
||||
std::unique_ptr<ParticleFunctionController> object(new ParticleFunctionController(std::forward<Args>(args)...));
|
||||
object->SetPersistent(false);
|
||||
|
||||
return object.release();
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user