cglm
Nim wrapper for cglm, an optimized 3D math library written in C99
Wraps a native library — check OS Compatibility below for platform-specific linking notes.
Summary
| Latest Version | 0.1.0 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-07-21 05:27 |
Tags
Authors
- Niminem (Leon Lysak)
Installation
nimble install cglm
choosenim install cglm
git clone https://github.com/Niminem/cglm
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| cglm | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 2.0.0 | No |
Source
| Repository | https://github.com/Niminem/cglm |
|---|---|
| Homepage | https://github.com/Niminem/cglm |
| Registry Source | nimble_official |
README
cglm
Nim wrapper for cglm, an optimized 3D math library written in C99 (based on the c++ library glm).
Repo: https://github.com/recp/cglm
Docs: https://cglm.readthedocs.io/en/latest/index.html
Current version: v0.9.6
In this cglm wrapper we use the Array API
NOTE: This is a rather verbose and ugly API IMO. However, it is feature complete and we can create high-level Nim wrapper from this base easily. The Struct API is along the lines of what we want to accomplish for a more Nim-like wrapper. I will build on top of this as I have the time, otherwise PRs are welcomed.
Installation
git clone https://github.com/Niminem/cglm
or, when available on Nimble:
nimble install cglm
Misc.
applesimd.hwas not wrapped. This header just provides helpers to convert cglm's types to apple's simd library to make it easy to use cglm with Apple's Metal / MetalGL api.- To allow
clgmto use SIMD instructions like SSE2 or NEON, simply enable the instruction set via compiler flag like:
{.passC: "-msse2".} ## for x86-64 platforms