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:
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