49 lines
1.4 KiB
Text
49 lines
1.4 KiB
Text
----------------------------------------------------------
|
|
Handmade Math
|
|
----------------------------------------------------------
|
|
|
|
jai ./generate.jai # generate the bindings (not required)
|
|
|
|
#import "jc/hmm"(
|
|
STATIC = true, # if HMM should be linked statically (default: true)
|
|
SIMD = true, # if SIMD should be used (default: true)
|
|
UNITS = .radians, # angle units to use [radians, degrees, turns] (default: radians)
|
|
);
|
|
|
|
What
|
|
----
|
|
|
|
Configurable, auto-generated bindings for Handmade Math
|
|
|
|
How
|
|
---
|
|
|
|
These are generated from HandmadeMath.h using Jai's
|
|
Bindings_Generator module. Because HandmadeMath is a
|
|
header-only library, we need to compile it into a
|
|
static/dynamic library that can be used with Jai's FFI
|
|
system. 'generate.jai' creates both static and dynamic
|
|
libraries for each angle unit in HandmadeMath
|
|
(radians, degrees, turns) +- SIMD support. These are
|
|
placed in the corresponding 'win', 'mac', or 'linux'
|
|
directories.
|
|
|
|
'module.jai' conditionally links one of these libraries
|
|
based on the module parameters set.
|
|
|
|
Why
|
|
---
|
|
|
|
A few liberties were taken during the binding process to
|
|
either fix issues with automatic binding generation, or
|
|
improve the usability of these bindings.
|
|
|
|
Here are the main changes:
|
|
|
|
- Converted procedure argument names from PascalCase
|
|
to snake_case
|
|
|
|
- Converted struct field names from PascalCase to
|
|
snake_case
|
|
|
|
- Procedure names still use PascalCase
|