aboutsummaryrefslogtreecommitdiff
path: root/smelt/sdl/CxImage/ximath.h
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-06 21:28:40 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-10-06 21:28:40 +0800
commit038b31f0158a0018dbf2eceb71026cc4e665faa9 (patch)
treea373ddab7bc162e477e28a780b0d729660ff8634 /smelt/sdl/CxImage/ximath.h
parenta8077292d5d9118866f7358c11a90c855e1b1b02 (diff)
downloadSMELT-038b31f0158a0018dbf2eceb71026cc4e665faa9.tar.xz
Add the SMELT files...
Please, do not laugh too loudly.
Diffstat (limited to 'smelt/sdl/CxImage/ximath.h')
-rw-r--r--smelt/sdl/CxImage/ximath.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/smelt/sdl/CxImage/ximath.h b/smelt/sdl/CxImage/ximath.h
new file mode 100644
index 0000000..014c14b
--- /dev/null
+++ b/smelt/sdl/CxImage/ximath.h
@@ -0,0 +1,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