#ifndef __TEXTURED_WARD_H__
#define __TEXTURED_WARD_H__

#include "configh.h"
#include "ward.h"
#include "vector3.h"

#define TEX_WIDTH 500
#define TEX_HEIGHT 500

class CWardTextured :
  public CSurfaceWardAnisotropic
{
public:
	CWardTextured(CTexture *rho_d, CTexture *rho_s, CSlopeMicrofacets *slope):
		CSurfaceWardAnisotropic(rho_d, rho_s, slope)
	{
		InitTexture();
	}
	CWardTextured():
		CSurfaceWardAnisotropic()
	{
		InitTexture();
	}
	virtual ~CWardTextured() 
	{
		delete[] _tex_image;
	}
	virtual int
  SpawnStochasticRays(CContributionArray  &carray,
		      const CHitPointInfo &hitInfo,
		      CSamplingInfo       &samplingInfo,
		      EDistributionType    distType = EE_ALL) const;

  virtual bool
  EvaluateBSDF(CValues             &result,
	       const CHitPointInfo &hitInfo,
	       const CVector3D     &dirIn,
	       EDistributionType   distType = EE_ALL) const;

protected:
	void InitTexture();
protected:

	CVector3D* _tex_image;
};

#endif //__TEXTURED_WARD__
