/*
	ZTriTessellator.h
	Author: Patrick Baggett <ptbaggett@762studios.com>
			Chris Ertel <crertel@762studios.com>

	Purpose: Implementation of tessellator interface that tessellates into lists of triangles (unindexed)

	Changelog
	2011/09/18 - creation (ptbaggett)
	2012/08/05 - Updated to use new SST functions.
*/

#pragma once

#ifndef _ZTRITESSELLATOR_HPP
#define _ZTRITESSELLATOR_HPP

#include <SST/SST_Vec2.h>

#include <ZRendererUtil/ZTessellatorBase.hpp>

class ZTriTessellator : public ZTessellatorBase
{
protected:
	//Our set of vertices
	ZArray<SST_Vec2f>& Vertices;

	//Temporary use array
	ZArray<SST_Vec2f> Temp;

	//Tessellation poly type
	ZTesselatorPolyType PolyType;

public:
	//Dumps a list of vertices into 'verts' when complete
	ZTriTessellator(ZOutlineEvaluator* _eval, ZArray<SST_Vec2f>& _verts);

	//Subclass Implementation
	virtual void BeginTessellate();

	//Subclass Implementation
	virtual void EndTessellate();

	//Subclass Implementation
	virtual void BeginPoly(ZTesselatorPolyType _type);

	//Subclass Implementation
	virtual void EndPoly();

	//Subclass Implementation
	virtual void Vertex(SST_Vec2f* _p);
};

#endif

