//------------------------------------------------------------------------------------
// irr::core::position2df wrappers
//------------------------------------------------------------------------------------

// defaults: x,y=0.0f
extern "C" 
{

	position2df* IrrCore_Position2df_new(f32 x,f32 y)
	{
		return new position2df(x,y);
	}
	
	position2df* IrrCore_Position2df_newFromPos(position2df* pos)
	{
		return new position2df(*pos);
	}
	
	
	void IrrCore_Position2df_del(position2df* del)
	{
		if (del)
			delete del;
			
		del=0;
	}
	
	f32 IrrCore_Position2df_getX(position2df* pos)
	{
		f32 fRetVal=0.0f;
	
		if (pos)
			fRetVal=pos->X;
	
		return fRetVal;
	}
	
	f32 IrrCore_Position2df_getY(position2df* pos)
	{
		f32 fRetVal=0.0f;
	
		if (pos)
			fRetVal=pos->Y;
	
		return fRetVal;
	}
	
	void IrrCore_Position2df_setX(position2df* pos,f32 x)
	{
		if (pos)
			pos->X=x;
	}
	
	void IrrCore_Position2df_setY(position2df* pos,f32 y)
	{
		if (pos)
			pos->Y=y;
	}
	
	bool IrrCore_Position2df_EqEq(position2df* pos,position2df* other)
	{
		return (*pos==*other);
	}
	
	bool IrrCore_Position2df_NotEq(position2df* pos,position2df* other)
	{
		return (*pos!=*other);
	}
		
	position2df* IrrCore_Position2df_Eq(position2df* pos,position2df* other)
	{
		return new position2df(*pos=*other);
	}
	
	position2df* IrrCore_Position2df_Plus(position2df* pos,position2df* other)
	{
		return new position2df(*pos + *other);
	}
	
	position2df* IrrCore_Position2df_Minus(position2df* pos,position2df* other)
	{
		return new position2df(*pos - *other);
	}

	position2df* IrrCore_Position2df_PlusDim(position2df* pos,dimension2df* other)
	{
		return new position2df(*pos + *other);
	}
	
	position2df* IrrCore_Position2df_MinusDim(position2df* pos,dimension2df* other)
	{
		return new position2df(*pos - *other);
	}	
	
	position2df* IrrCore_Position2df_Mult(position2df* pos,position2df* other)
	{
		return new position2df(*pos * *other);
	}

	position2df* IrrCore_Position2df_MultScalar(position2df* pos,const f32& scalar)
	{
		return new position2df(*pos * scalar);
	}

	// do not delete
	position2df* IrrCore_Position2df_PlusEq(position2df* pos,const position2d<f32>& other)
	{
		if (pos) {
			*pos+=other;
			return pos;
		} else return 0;
	}

	// do not delete
	position2df* IrrCore_Position2df_MinusEq(position2df* pos,const position2d<f32>& other)
	{
		if (pos) {
			*pos-=other;
			return pos;
		} else return 0;
	}

	// do not delete
	position2df* IrrCore_Position2df_PlusEqDim(position2df* pos,const dimension2d<f32>& other)
	{
		if (pos) {
			*pos+=other;
			return pos;
		} else return 0;
	}

	// do not delete
	position2df* IrrCore_Position2df_MinusEqDim(position2df* pos,const dimension2d<f32>& other)
	{
		if (pos) {
			*pos-=other;
			return pos;
		} else return 0;
	}	
}