/*
	ZStandardParticleRenderStrategy.h
	Author: James Russell <jcrussell@762studios.com>

	Purpose: TODO

	Changelog
	2011/09/11 - creation (jcrussell)
*/

#pragma once

#ifndef _ZSTANDARDPARTICLERENDERSTRATEGY_H
#define _ZSTANDARDPARTICLERENDERSTRATEGY_H

#include <ZRendererUtil/ZParticleRenderStrategy.h>
#include <ZRendererUtil/ZStandardParticleStorageAllocator.h>

class ZStandardParticleRenderStrategy : public ZParticleRenderStrategy
{
protected:
	//Vertex buffer
	ZPtr<ZDataBuffer> VertexBuffer;
	
	//Index buffer
	ZPtr<ZDataBuffer> IndexBuffer;

	//Material we use
	ZPtr<ZMaterialSurface> ParticleMaterial;

	//Texture we'll be using
	ZPtr<ZTexture2D> ParticleTexture;

	//Our render state
	ZRenderState RenderState;

	//Our UV coordinates (per vertex)
	float UVs[8];

public:
	/*
	Constructor.

	@param _maxParticles - maximum number of particles we will use
	@param _renderer - the renderer instance
	*/
	ZStandardParticleRenderStrategy();

	/*
	Destructor.
	*/
	~ZStandardParticleRenderStrategy();

	/*
	public ZStandardParticleRenderStrategy::SetParticleTexture
	
	TODO
	
	@param _texture - 
	@return (void)
	@context (all)
	*/
	void SetParticleTexture(ZPtr<ZTexture2D> _texture);

	/*
	public ZStandardParticleRenderStrategy::SetParticleTextureUVs
	
	TODO
	
	@param _uvs - uv coordinate array (size 8)
	@return (void)
	@context (all)
	*/
	void SetParticleTextureUVs(float *_uvs);

	/*
	public ZStandardParticleRenderStrategy::SetRenderState
	
	TODO
	
	@param _state - 
	@return (void)
	@context (all)
	*/
	void SetRenderState(ZRenderState _state);

	//Subclass Override
	void AllocateBuffers(size_t _maxParticles, ZRenderer *_renderer);

	//Subclass Override
	virtual bool CheckParticleFormat( const ZString& _format );

	//Subclass Override
	virtual void RenderParticles(ZParticleEffect* _particleEffect, 
								 ZParticleEmitter* _particleEmitter, 
								 ZParticleStorageAllocator* _storageAllocator, 
								 ZRenderer* _renderer, 
								 ZFrameContext _frameContext,
								 const ZMatrix44f& _transform,
								 int _drawGroup );

};

#endif
 
