diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-10-28 16:35:21 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-10-28 16:35:21 +0800 |
commit | 0900cc583cc5e51b7c6b378de93cca29e11cb0e9 (patch) | |
tree | 47625b45ad1d4d63eaa59b2414f89fbfda33d035 /smelt/glfw/CxImage/ximath.h | |
parent | 6206029f2d0af3ef76a0a61ef024ca758307ba19 (diff) | |
download | SMELT-0900cc583cc5e51b7c6b378de93cca29e11cb0e9.tar.xz |
Add the GLFW port, still using OpenGL 2.1 though.
And a more detailed readme.
Diffstat (limited to 'smelt/glfw/CxImage/ximath.h')
-rw-r--r-- | smelt/glfw/CxImage/ximath.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/smelt/glfw/CxImage/ximath.h b/smelt/glfw/CxImage/ximath.h new file mode 100644 index 0000000..014c14b --- /dev/null +++ b/smelt/glfw/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
|