//------------------------------------------------------------------------------------
// irr::video::SLight wrappers
//
// WARNING: do NOT release handles obtained via the get() methods
//------------------------------------------------------------------------------------

extern "C" 
{

	SLight* IrrVideo_SLight_new()
	{
		return new SLight();
	}
	
	void IrrVideo_SLight_del(SLight* del)
	{
		if (del)
			delete del;
			
		del=0;
	}
	
	SColorf* IrrVideo_SLight_getAmbientColor(SLight* light)
	{
		if (light)
			return &light->AmbientColor;
		else
			return 0;
	}
	
	SColorf* IrrVideo_SLight_getDiffuseColor(SLight* light)
	{
		if (light)
			return &light->DiffuseColor;
		else
			return 0;
	}
	
	SColorf* IrrVideo_SLight_getSpecularColor(SLight* light)
	{
		if (light)
			return &light->SpecularColor;
		else
			return 0;
	}
	
	vector3df* IrrVideo_SLight_getPosition(SLight* light)
	{
		if (light)
			return &light->Position;
		else
			return 0;
	}

	vector3df* IrrVideo_SLight_getDirection(SLight* light)
	{
		if (light)
			return &light->Direction;
		else
			return 0;
	}
	
	bool IrrVideo_SLight_getCastShadows(SLight* light)
	{
		if (light)
			return light->CastShadows;
		else
			return false;
	}
	
	void IrrVideo_SLight_setCastShadows(SLight* light,bool bCastShadows)
	{
		if (light)
			light->CastShadows=bCastShadows;
	}
	
	f32 IrrVideo_SLight_getRadius(SLight* light)
	{
		if (light)
			return light->Radius;
		else
			return 0.0f;
	}
	
	void IrrVideo_SLight_setRadius(SLight* light,f32 newrad)
	{
		if (light)
			light->Radius=newrad;
	}
	
	s32 IrrVideo_SLight_getType(SLight* light)
	{
		if (light)
			return light->Type;
		else	return -1;
	}
	
	void IrrVideo_SLight_setType(SLight* light,E_LIGHT_TYPE newType)
	{
		if (light)
			light->Type=newType;
	}

	// do not delete
	vector3df* IrrVideo_SLight_getAttenuation(SLight* light)
	{
		if (light) {
			return &light->Attenuation;
		} else return 0;
	}

	f32 IrrVideo_SLight_getOuterCone(SLight* light)
	{
		if (light)
			return light->OuterCone;
		else
			return 0.0f;
	}
	
	void IrrVideo_SLight_setOuterCone(SLight* light,f32 outercone)
	{
		if (light)
			light->OuterCone = outercone;
	}

	f32 IrrVideo_SLight_getInnerCone(SLight* light)
	{
		if (light)
			return light->InnerCone;
		else
			return 0.0f;
	}
	
	void IrrVideo_SLight_setInnerCone(SLight* light,f32 innercone)
	{
		if (light)
			light->InnerCone = innercone;
	}

	f32 IrrVideo_SLight_getFalloff(SLight* light)
	{
		if (light)
			return light->Falloff;
		else
			return 0.0f;
	}
	
	void IrrVideo_SLight_setFalloff(SLight* light,f32 falloff)
	{
		if (light)
			light->Falloff = falloff;
	}

} // extern "C"