Get OpenXR fully up and running
Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
1133
src/LunarWM.cppm
1133
src/LunarWM.cppm
File diff suppressed because it is too large
Load Diff
@@ -61,6 +61,9 @@ Vec2<T> operator*(T scalar, Vec2<T> const &v) {
|
|||||||
template <typename T = float>
|
template <typename T = float>
|
||||||
requires std::is_arithmetic_v<T>
|
requires std::is_arithmetic_v<T>
|
||||||
struct Rect {
|
struct Rect {
|
||||||
|
Rect(Vec2<T> pos, Vec2<T> size) : pos(pos), size(size) {}
|
||||||
|
Rect(T x, T y, T w, T h) : pos({x, y}), size({w, h}) {}
|
||||||
|
|
||||||
T &x() { return pos.x; }
|
T &x() { return pos.x; }
|
||||||
T &y() { return pos.y; }
|
T &y() { return pos.y; }
|
||||||
T &w() { return size.x; }
|
T &w() { return size.x; }
|
||||||
@@ -79,8 +82,6 @@ struct Rect {
|
|||||||
T &left() { return x(); }
|
T &left() { return x(); }
|
||||||
T &top() { return y(); }
|
T &top() { return y(); }
|
||||||
|
|
||||||
Rect(T x, T y, T w, T h) : pos({x, y}), size({w, h}) {}
|
|
||||||
|
|
||||||
Vec2<T> pos, size;
|
Vec2<T> pos, size;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -190,5 +191,12 @@ std::vector<Math::Rect<T>> subtract_rect(Math::Rect<T> const &src,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T = float>
|
||||||
|
requires std::is_arithmetic_v<T>
|
||||||
|
struct Viewport {
|
||||||
|
Rect<T> rect;
|
||||||
|
Vec2<T> depth_limits;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Math
|
} // namespace Math
|
||||||
} // namespace LunarWM
|
} // namespace LunarWM
|
||||||
|
|||||||
Reference in New Issue
Block a user