This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
space-war/libmath.hpp

33 lines
632 B
C++

#pragma once
struct Point {
float x;
float y;
};
struct Rect {
float x;
float y;
float w;
float h;
};
struct Color {
float r;
float g;
float b;
float a;
};
using Size = Point;
using Rect = Rect;
Point operator+(const Point& p1, const Point& p2);
Point operator-(const Point& p1, const Point& p2);
Point operator*(const Point& p1, const Point& p2);
Point operator/(const Point& p1, const Point& p2);
Point& operator+=(Point& p1, const Point& p2);
Point& operator-=(Point& p1, const Point& p2);
Point& operator*=(Point& p1, const Point& p2);
Point& operator/=(Point& p1, const Point& p2);