From aae82c1d4ac8b499779fbb46dfb2321ad23ab579 Mon Sep 17 00:00:00 2001 From: zorby Date: Sat, 4 Jan 2025 11:48:55 +0100 Subject: [PATCH] README: Add chapter about alignment --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b87f04a..0f02789 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@

-Also known as OpenGL Mathematics (glm) for C, cglm provides fast and ergonomic math functions to ease graphics programming. It is community friendly – feel free to report any bugs and issues you face.
+A highly optimized 2D|3D math library. Also known as OpenGL Mathematics (glm) for C. cglm provides fast and ergonomic math functions to ease graphics programming. It is community friendly – feel free to report any bugs and issues you face.
If you're using C++, you might want to check out GLM

@@ -96,6 +96,10 @@ vec2 vector; glmc_vec2_zero(vector); ``` +### ❗ Alignment + +While cglm by default aligns what's necessary, it is possible to disable this by defining `CGLM_ALL_UNALIGNED`. If you're targeting machines with any kind of SIMD support, make sure that all `vec4`, `mat4` and `mat2` arguments you pass to cglm functions are aligned to prevent unexpected crashes, alternatively use the unaligned versions if present. + ### Struct API The struct API works as follows (note the `s` suffix on types, `glms_` prefix on functions and `GLMS_` on constants):