inline DXVector2::DXVector2(const float _x, const float _y)
{
	x = _x;
	y = _y;
}

inline DXVector2::DXVector2(const float* const v)
{
	x = v[0];
	y = v[1];
}

inline DXVector2::DXVector2(const DXVector2 &v)
{
	x = v.x;
	y = v.y;
}

//casting
inline DXVector2::operator float* ()
{
	return (float*) &x;
}

inline DXVector2::operator const float* () const
{
	return (const float*) &x;
}

inline DXVector2::operator D3DXVECTOR2* ()
{
	return (D3DXVECTOR2*) &x;
}

inline DXVector2::operator const D3DXVECTOR2* () const
{
	return (const D3DXVECTOR2*) &x;
}

inline DXVector2::operator D3DXVECTOR2 () const
{
	return D3DXVECTOR2(x,y);
}

// assignment operators
inline DXVector2& DXVector2::operator += (const DXVector2& v)
{
	x += v.x;
    y += v.y;
	return *this;
}

inline DXVector2& DXVector2::operator -= (const DXVector2& v)
{
	x -= v.x;
    y -= v.y;
	return *this;
}

inline DXVector2& DXVector2::operator *= (const float f)
{
	x *= f;
    y *= f;
	return *this;
}

inline DXVector2& DXVector2::operator /= (const float f)
{
	x /= f;
    y /= f;
	return *this;
}

// unary operators
inline DXVector2 DXVector2::operator + () const
{
	return *this;
}

inline DXVector2 DXVector2::operator - () const
{
	return DXVector2(-x, -y);
}

// binary operators
inline DXVector2 DXVector2::operator + (const DXVector2& v) const
{
	return DXVector2(x + v.x, y + v.y);
}

inline DXVector2 DXVector2::operator - (const DXVector2& v) const
{
	return DXVector2(x - v.x, y - v.y);
}

inline DXVector2 DXVector2::operator * (const float f) const
{
	return DXVector2(x * f, y * f);
}

inline DXVector2 DXVector2::operator / (const float f) const
{
	return DXVector2(x / f, y / f);
}

inline DXVector2 operator * ( const float f, const DXVector2& v)
{
	return DXVector2(f * v.x, f * v.y);
}

inline bool DXVector2::operator == ( const DXVector2& v) const
{
	 return x == v.x && y == v.y;
}

inline bool DXVector2::operator != ( const DXVector2& v) const
{
	 return x != v.x || y != v.y;
}

//calculations
inline float DXVector2::Dot(const DXVector2& vec) const 
{ 
	return D3DXVec2Dot((D3DXVECTOR2*)this, (D3DXVECTOR2*)&vec); 
}

inline float DXVector2::Length(void) const 
{ 
	return D3DXVec2Length((D3DXVECTOR2*)this); 

}

inline DXVector2 DXVector2::Min(const DXVector2& a, const DXVector2& b)
{
	return DXVector2(_min(a.x, b.x), _min(a.y, b.y));
}

inline DXVector2 DXVector2::Max(const DXVector2& a, const DXVector2& b)
{
	return DXVector2(_max(a.x, b.x), _max(a.y, b.y));
}