#ifndef H_PARTICLESYSTEM
#define H_PARTICLESYSTEM

#include "includes.h"
#include "actor.h"
#include "textfile.h"

class ParticleSystem: public Actor
{
public:
      struct Particle
        {
        Vector4f location;      //4th value is used for scale
        Vector4f color;

        float birth;
        };

      std::vector<Particle> particles;

      ParticleSystem();

      virtual void setup();
      virtual void linkShaderVariables();

      virtual void update(double deltaTime);
      virtual void updateShaders();

      virtual void drawParticles();

      void addParticles(int amount);
      void addRandomParticles(int amount, float diameter);
      void createSquare(float xStretch, float zStretch);

      void create();
      virtual TiXmlElement* save(TiXmlElement *root);
      virtual void load(TiXmlElement *myInfo);
};
#endif
