From 3a94328b3cff255ac64a208ac98919cc3e530aa0 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 5 May 2019 22:53:12 +0400 Subject: Made changes to CMakeLists.txt so CUDA version of program builds when CUDA is installed. Replaced C-style approach to generating texture to OOP-style with Canvas.h --- libraries/point/Point.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 libraries/point/Point.h (limited to 'libraries/point/Point.h') diff --git a/libraries/point/Point.h b/libraries/point/Point.h new file mode 100644 index 0000000..8163f8f --- /dev/null +++ b/libraries/point/Point.h @@ -0,0 +1,30 @@ +// +// Created by saintruler on 11.04.19. +// + +#ifndef OPENGLTEST_POINT_H +#define OPENGLTEST_POINT_H + +#include + +class Point +{ +public: + Point(double x, double y); + + friend Point operator+(const Point& left, const Point& right); + friend Point operator+=(Point& left, const Point& right); + friend Point operator-(const Point& left, const Point& right); + friend Point operator-=(Point& left, double right); + friend Point operator/(const Point& left, double right); + friend Point operator/=(Point& left, double right); + friend Point operator*(const Point& left, double right); + friend Point operator*=(Point& left, double right); + + double length(); + double length_squared(); + void normalize(); + double x, y; +}; + +#endif //OPENGLTEST_POINT_H -- cgit v1.2.3