github recp/cglm v0.9.0
v0.9.0: WASM 128 SIMD + Struct Api Namespace Configuration + Bug Fixes

latest releases: v0.9.4, v0.9.3, v0.9.2...
18 months ago

🚀 WASM 123 SIMD Support

Now we have WASM 128 SIMD support ( many thanks to @myfreeer ).

Compiling

Currently the tests can be cross-compiled to wasi using clang and wasi-sdk with cmake arguments below:

-DCMAKE_C_FLAGS="-msimd128"
-DCMAKE_TOOLCHAIN_FILE=/path/to/wasi-sdk-19.0/share/cmake/wasi-sdk.cmake
-DWASI_SDK_PREFIX=/path/to/wasi-sdk-19.0
-DCGLM_USE_TEST=ON

Where /path/to/wasi-sdk-19.0/ is the path to extracted wasi sdk.

🚀 Struct API Namespace Configuration

Now we can omit or change namespace of struct api which was ( and still as default ) glms_. We can omit the namespace completely to use like mat4_mul(mat4_mul(m1, m2), m3) ... or option to use like mat4s_mul(mat4s_mul(m1, m2), m3)...

This makes things more flexible & readable for struct api.

now we can omit glms_ like:

/* previous / default */
return glms_vec3_normalized(glms_vec3_cross(a, b));

/* this must be defined before cglm inc especially common.h */
#define CGLM_OMIT_NS_FROM_STRUCT_API /* or define at compiler settings */

/* new!! */
return vec3_normalized(vec3_cross(a, b));

/* if CGLM_STRUCT_API_NAME_SUFFIX is defined as `s`  */
return vec3s_normalized(vec3s_cross(a, b));

new options:

  • CGLM_OMIT_NS_FROM_STRUCT_API, omits CGLM_STRUCT_API_NS (glms_) namespace completely if there is sub namespace e.g mat4_, vec4_ ... DEFAULT is not defined
  • CGLM_STRUCT_API_NS: define name space for struct api, DEFAULT is glms
  • CGLM_STRUCT_API_NAME_SUFFIX: define name suffix, DEFAULT is empty e.g defining it as #define CGLM_STRUCT_API_NAME_SUFFIX s will add s suffix to mat4_mul -> mat4s_mul

🛠️ Bugfixes and Improvements:

❤️ Sponsorship: Consider become a sponsor for cglm

Supporting cross platform, multiple OS-es and multiple CPUs requires multiple hardwares to test on it which requires extra financial cost. Also sparing time is another big issue while working at somewhere fulltime... Your company can become a sponsor to help:

https://github.com/sponsors/recp
https://opencollective.com/cglm#backer
https://patreon.com/recp

Don't miss a new cglm release

NewReleases is sending notifications on new releases.