# cglm Documentation

cglm is an optimized 3D math library written in C99 (compatible with C89). It is similar to the original glm library, except cglm is mainly for C.

cglm stores matrices as column-major order but in the future row-major is considered to be supported as optional.

Getting Started:

- Features
- Build cglm
  - CMake (All platforms):
  - Meson (All platforms):
  - Unix (Autotools):
  - Windows (MSBuild):
  - Documentation (Sphinx):
- Getting Started
  - Types:
  - Alignment Is Required:
  - Allocations:
  - Array vs Struct:
  - Function design:

How To:

- How to send vector or matrix to OpenGL like API
  - Passing / Uniforming Matrix to OpenGL:
  - Passing / Uniforming Vectors to OpenGL:

API:

- 📚 API documentation
  - Array API - Inline (Default)
    - 3D Affine Transforms
    - 3D Affine Transform Matrix (specialized functions)
    - 2D Affine Transforms
    - camera
    - frustum
    - axis aligned bounding box (AABB)
    - 2d axis aligned bounding box (AABB)
    - quaternions
    - euler angles
    - mat2
    - mat2x3
    - mat2x4
    - mat3
    - mat3x2
    - mat3x4
    - mat4
    - mat4x2
    - mat4x3
    - vec2
    - vec2 extra
    - vec3
    - vec3 extra
    - vec4
    - vec4 extra
    - ivec2
    - ivec3
    - ivec4
    - color
    - plane
    - perlin
    - Project / UnProject
    - utils / helpers
    - io (input / output e.g. print)
    - precompiled functions (call)
    - Sphere
    - Curve
    - Bezier
    - version
    - ray
  - Struct API
    - Struct API usage:
  - Call API
  - SIMD API

Options:

- 🛠️ Options
  - Alignment Option
  - Clipspace Option[s]
  - SSE and SSE2 Shuffle Option
  - SSE3 and SSE4 Dot Product Options
  - Struct API Options
  - Print Options

Troubleshooting:

- Troubleshooting
  - Memory Allocation:
  - Alignment:
  - Crashes, Invalid Memory Access:
  - Wrong Results:
  - BAD_ACCESS : Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT) or Similar Errors/Crashes
  - Other Issues?

# Indices and Tables:

- Index

- Module Index

- Search Page