summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-11 23:53:46 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-11 23:53:46 +0100
commit6013bac1556659f1685170b5e68752189f0b93ba (patch)
tree166edafb021b49144211410c109a404fe44a2101 /src/utils.h
parent50a84a54e7cc2308ad87bd04e065151a61ffe513 (diff)
assembling vertices
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index 00be767..5a47c44 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -77,6 +77,8 @@ static inline u32 wayc_min(u32 a, u32 b) { return a > b ? a : b; }
#define WAYC_X(v) ((v)[0])
#define WAYC_Y(v) ((v)[1])
+#define WAYC_TRIANGLE_NVERTS 3
+
static inline usize wayc_max(usize a, usize b) { return a > b ? a : b; }
template <typename A, typename B>
@@ -117,3 +119,21 @@ struct defer_cond_s {
#define wayc_defer_cond(func, cond, expected) \
auto WAYC_UNIQUE(_defer_) = defer_cond_s([&]() { func; }, &cond, expected)
+
+struct string_s {
+ char* data;
+ usize length;
+};
+
+#define WAYC_STRING_INIT(str, len) \
+ string_s { str, len }
+
+static inline usize wayc_string_length(const struct string_s* str) {
+ wayc_notnull(str);
+ return str->length;
+}
+
+static inline char* wayc_string_data(const struct string_s* str) {
+ wayc_notnull(str);
+ return str->data;
+} \ No newline at end of file