Bound line type

This commit is contained in:
2023-05-27 17:07:15 +02:00
parent 81bb8c76fa
commit f67361c62b
3 changed files with 23 additions and 5 deletions

View File

@@ -50,6 +50,8 @@ namespace JabyEngine {
Code code = IdentityCode;
};
typedef Vertex Body;
union {
Head head;
Vertex vertex;
@@ -67,6 +69,19 @@ namespace JabyEngine {
return {.vertex = {static_cast<short>(0xF000), static_cast<short>(0xF000u)}};
}
};
struct LineMaker {
// Make this it's own outside type??
template<typename T, size_t N>
struct Type {
T head;
T body[N];
};
static constexpr Type<LINE_F, 2> new_line_f(const Color24& color, const Vertex (&vertices)[2]) {
return Type<LINE_F, 2>{.head = LINE_F::new_line(color, false), .body = {LINE_F::new_point(vertices[0]), LINE_F::new_point(vertices[1])}};
}
};
}
}