//------------------------------------------------------------------------------------
// irr::core::SMaterialLayer wrappers
//------------------------------------------------------------------------------------

extern "C" 
{

	SMaterialLayer* IrrVideo_SMaterialLayer_new()
	{
		return new SMaterialLayer();
	}
	
	SMaterialLayer* IrrVideo_SMaterialLayer_newFromOther(SMaterialLayer* other)
	{
		return new SMaterialLayer(*other);
	}
	
	void IrrVideo_SMaterialLayer_del(SMaterialLayer* del)
	{
		if (del)
			delete del;
			
		del=0;
	}

	// do not delete
	SMaterialLayer* IrrVideo_SMaterialLayer_setEq(SMaterialLayer* ml, SMaterialLayer* other)
	{
		if (ml) {
			*ml = *other;
		}
		
		return ml;
	}

	// do not delete
	ITexture* IrrVideo_SMaterialLayer_getTexture(SMaterialLayer* ml)
	{
		if (ml) {
			return ml->Texture;
		} else return 0;
	}
	
	void IrrVideo_SMaterialLayer_setTexture(SMaterialLayer* ml, ITexture* texture) 
	{
		if (ml) {
			*ml->Texture = *texture;
		}
	}

	s32 IrrVideo_SMaterialLayer_getTextureWrapU(SMaterialLayer* ml)
	{
		if (ml) {
			return ml->TextureWrapU;
		} else return -1;
	}
	
	void IrrVideo_SMaterialLayer_setTextureWrapU(SMaterialLayer* ml, E_TEXTURE_CLAMP wrap)	
	{
		if (ml) {
			ml->TextureWrapU = wrap;
		}
	}

	s32 IrrVideo_SMaterialLayer_getTextureWrapV(SMaterialLayer* ml)
	{
		if (ml) {
			return ml->TextureWrapV;
		} else return -1;
	}
	
	void IrrVideo_SMaterialLayer_setTextureWrapV(SMaterialLayer* ml, E_TEXTURE_CLAMP wrap)	
	{
		if (ml) {
			ml->TextureWrapV = wrap;
		}
	}

	bool IrrVideo_SMaterialLayer_getBilinearFilter(SMaterialLayer* ml)	
	{
		if (ml) {
			return ml->BilinearFilter;
		} else return false;
	}

	void IrrVideo_SMaterialLayer_setBilinearFilter(SMaterialLayer* ml, bool filter)
	{
		if (ml) {
			ml->BilinearFilter = filter;
		}		
	}

	bool IrrVideo_SMaterialLayer_getTrilinearFilter(SMaterialLayer* ml)	
	{
		if (ml) {
			return ml->TrilinearFilter;
		} else return false;
	}

	void IrrVideo_SMaterialLayer_setTrilinearFilter(SMaterialLayer* ml, bool filter)
	{
		if (ml) {
			ml->TrilinearFilter = filter;
		}
	}

	u8 IrrVideo_SMaterialLayer_getAnisotropicFilter(SMaterialLayer* ml)	
	{
		if (ml) {
			return ml->AnisotropicFilter;
		} else return false;
	}
	
	void IrrVideo_SMaterialLayer_setAnisotropicFilter(SMaterialLayer* ml, u8 filter)	
	{
		if (ml) {
			ml->AnisotropicFilter = filter;
		}
	}

	// must delete
	matrix4* IrrVideo_SMaterialLayer_getTextureMatrix(SMaterialLayer* ml) 
	{
		if (ml) {
			return new matrix4(ml->getTextureMatrix());
		} else return 0;
	}
	
	void IrrVideo_SMaterialLayer_setTextureMatrix(SMaterialLayer* ml, matrix4* mat) 
	{
		if (ml) {
			ml->setTextureMatrix(*mat);
		}
	}
	
	bool IrrVideo_SMaterialLayer_NotEq(SMaterialLayer* ml, SMaterialLayer* b)
	{
		if (ml) {
			return (*ml != *b);
		} else return false;
	}

	bool IrrVideo_SMaterialLayer_EqEq(SMaterialLayer* ml, SMaterialLayer* b)
	{
		if (ml) {
			return (*ml == *b);
		} else return false;
	}
	
	s8 IrrVideo_SMaterialLayer_getLODBias(SMaterialLayer* ml)
	{
		if (ml)
			return ml->LODBias;
		else return 0;
	}
	
	void IrrVideo_SMaterialLayer_setLODBias(SMaterialLayer* ml, s8 LODBias)
	{
		if (ml)
			ml->LODBias = LODBias;
	}
	
}
