aboutsummaryrefslogtreecommitdiff
path: root/smelt/glfw/CxImage/ximath.h
blob: 014c14b80ee932d81143856bda1d3f143ceca0c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#if !defined(__ximath_h)
#define __ximath_h

#include "ximadef.h"

//***bd*** simple floating point point
class DLL_EXP CxPoint2
{
public:
  CxPoint2();
  CxPoint2(float const x_, float const y_);
  CxPoint2(CxPoint2 const &p);

  float Distance(CxPoint2 const p2);
  float Distance(float const x_, float const y_);

  float x,y;
};

//and simple rectangle
class DLL_EXP CxRect2
{
public:
  CxRect2();
  CxRect2(float const x1_, float const y1_, float const x2_, float const y2_);
  CxRect2(CxPoint2 const &bl, CxPoint2 const &tr);
  CxRect2(CxRect2 const &p);

  float Surface() const;
  CxRect2 CrossSection(CxRect2 const &r2) const;
  CxPoint2 Center() const;
  float Width() const;
  float Height() const;

  CxPoint2 botLeft;
  CxPoint2 topRight;
};

#endif