#pragma once
#include "../../stdafx.h"

#include "glLibRenderer.h"

#include "../glLibShader.h"

namespace glLib {

namespace Render {

class renderer_particle : glLibInternal_renderer {
	friend class ::glLib::Effect::Particle::particle_system;
	public:
		string errors;
	private:
		shader* _shader;
		bool _inited;

		#ifdef GLLIB_ERROR_MODE_REPORT_WARNINGS
		bool _has_set_variables;
		bool _has_set_size;
		bool _has_set_color;
		bool _has_warned_variables;
		bool _has_warned_size;
		bool _has_warned_color;
		#endif

		GLuint _location_params1;

	public:
		renderer_particle(void);
		~renderer_particle(void);

		void set_variables(void);
		void set_variables(const string source);
		void set_calculation_size(const string source, bool attenuate=true);
		void set_calculation_color(const string source);

		void init(void);

	private:
		void glLibInternal_draw_begin(const ::glLib::Texture::texture_2D* texture_particle);
		void glLibInternal_draw_end(void) const;
};

};};