add: RenderTarget
This commit is contained in:
56
frame/src/Vector.hpp
Normal file
56
frame/src/Vector.hpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "Size.hpp"
|
||||
|
||||
namespace frame
|
||||
{
|
||||
struct Vector
|
||||
{
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
|
||||
Vector() = default;
|
||||
Vector(int32_t x, int32_t)
|
||||
: x(x)
|
||||
, y(y)
|
||||
{
|
||||
}
|
||||
|
||||
Vector(Size const& size)
|
||||
: x(size.width)
|
||||
, y(size.width)
|
||||
{
|
||||
}
|
||||
|
||||
void operator=(Size const& size)
|
||||
{
|
||||
x = size.width;
|
||||
y = size.height;
|
||||
}
|
||||
};
|
||||
|
||||
inline bool operator==(Vector const& a, Vector const& b)
|
||||
{
|
||||
return a.x == b.x && a.y == b.y;
|
||||
}
|
||||
|
||||
inline bool operator!=(Vector const& a, Vector const& b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
inline Vector& operator+=(Vector& a, Vector const& b)
|
||||
{
|
||||
a.x += b.x;
|
||||
a.y += b.y;
|
||||
return a;
|
||||
}
|
||||
|
||||
inline Vector& operator-=(Vector& a, Vector const& b)
|
||||
{
|
||||
a.x -= b.x;
|
||||
a.y -= b.y;
|
||||
return a;
|
||||
}
|
||||
|
||||
} // namespace frame
|
||||
Reference in New Issue
Block a user