1 // Copyright (C) 2002-2007 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
5 #ifndef __IRR_DIMENSION2D_H_INCLUDED__
6 #define __IRR_DIMENSION2D_H_INCLUDED__
15 //! Specifies a 2 dimensional size.
20 dimension2d() : Width(0), Height(0) {}
22 dimension2d(const T
& width
, const T
& height
)
23 : Width(width
), Height(height
) {}
25 bool operator == (const dimension2d
<T
>& other
) const
27 return Width
== other
.Width
&& Height
== other
.Height
;
30 bool operator != (const dimension2d
<T
>& other
) const
32 return ! (*this == other
);
35 dimension2d
<T
>& set(const T
& width
, const T
& height
)
42 dimension2d
<T
>& operator/=(const T
& scale
)
49 dimension2d
<T
> operator/(const T
& scale
) const
51 return dimension2d
<T
>(Width
/scale
, Height
/scale
);
54 dimension2d
<T
>& operator*=(const T
& scale
)
61 dimension2d
<T
> operator*(const T
& scale
) const
63 return dimension2d
<T
>(Width
*scale
, Height
*scale
);
69 //! Typedef for a f32 dimension.
70 typedef dimension2d
<f32
> dimension2df
;
71 //! Typedef for an integer dimension.
72 typedef dimension2d
<s32
> dimension2di
;
74 } // end namespace core
75 } // end namespace irr