82 lines
1.9 KiB
C++
82 lines
1.9 KiB
C++
/*
|
|
ZParticleGenerator.h
|
|
Author: James Russell <jcrussell@762studios.com>
|
|
|
|
Purpose: The particle generator is responsible for generating / allocating the particle data
|
|
and storing it for the duration the particle emitter is alive.
|
|
|
|
Also responsible for cleanup.
|
|
|
|
Changelog
|
|
2011/08/28 - creation (jcrussell)
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#ifndef _ZPARTICLESTORAGEALLOCATOR_H
|
|
#define _ZPARTICLESTORAGEALLOCATOR_H
|
|
|
|
#include <ZUtil/ZUtil.hpp>
|
|
|
|
//Forward Declaration
|
|
class ZParticleEffect;
|
|
class ZParticleEmitter;
|
|
|
|
class ZParticleStorageAllocator
|
|
{
|
|
public:
|
|
//Virtual Destructor
|
|
virtual ~ZParticleStorageAllocator() { }
|
|
|
|
/*
|
|
virtual public ZParticleGenerator::AllocateParticleStorage
|
|
|
|
Allocates particle storage for this particle emitter.
|
|
|
|
@param _emitter - the emitter we are creating storage for
|
|
@param _maxParticles - the number of particles we allocate storage for
|
|
@return (void)
|
|
@context (all)
|
|
*/
|
|
virtual void AllocateParticleStorage(ZParticleEmitter* _emitter, size_t _maxParticles) = 0;
|
|
|
|
/*
|
|
virtual public ZParticleGenerator::DeallocateParticleStorage
|
|
|
|
Deallocates storage previously allocated with AllocateParticleStorage.
|
|
|
|
@return (void)
|
|
@context (all)
|
|
*/
|
|
virtual void DeallocateParticleStorage() = 0;
|
|
|
|
/*
|
|
virtual public ZParticleStorageAllocator::GetParticleFormat
|
|
|
|
Returns a string 'type' indicating the type of particle storage used by this allocator. Checked
|
|
against the other strategies to ensure compatibility.
|
|
|
|
@return (ZString)
|
|
@context (all)
|
|
*/
|
|
virtual ZString GetParticleFormat() = 0;
|
|
|
|
/*
|
|
virtual public ZParticleStorageAllocator::Update
|
|
|
|
Updates the storage allocator, indicating another frame has passed.
|
|
|
|
@param _effect - the particle effect
|
|
@param _emitter - the particle emitter
|
|
@param _dt - amount of time passed (in ms)
|
|
@return (void)
|
|
@context (all)
|
|
*/
|
|
virtual void Update(ZParticleEffect *_effect,
|
|
ZParticleEmitter *_emitter,
|
|
size_t _dt
|
|
) = 0;
|
|
};
|
|
|
|
#endif
|
|
|