From 6013bac1556659f1685170b5e68752189f0b93ba Mon Sep 17 00:00:00 2001 From: Fabrice Date: Wed, 11 Feb 2026 23:53:46 +0100 Subject: assembling vertices --- src/utils.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/utils.h') 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 @@ -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 -- cgit v1.2.3