2023-01-10 07:13:00 -06:00
|
|
|
#ifndef FFI_H
|
|
|
|
#define FFI_H
|
|
|
|
|
2023-04-18 14:49:17 -05:00
|
|
|
#include "quickjs/quickjs.h"
|
2023-12-22 11:50:03 -06:00
|
|
|
#include "HandmadeMath.h"
|
2024-01-14 10:24:31 -06:00
|
|
|
#include "dsp.h"
|
2023-01-10 07:13:00 -06:00
|
|
|
|
|
|
|
void ffi_load();
|
|
|
|
|
2023-11-14 09:20:09 -06:00
|
|
|
JSValue vec2js(HMM_Vec2 v);
|
|
|
|
HMM_Vec2 js2vec2(JSValue v);
|
2023-02-02 17:52:15 -06:00
|
|
|
|
2023-04-18 14:49:17 -05:00
|
|
|
JSValue bitmask2js(cpBitmask mask);
|
|
|
|
cpBitmask js2bitmask(JSValue v);
|
2023-10-10 17:37:58 -05:00
|
|
|
int js_print_exception(JSValue v);
|
2023-02-02 17:52:15 -06:00
|
|
|
|
2023-05-16 01:31:13 -05:00
|
|
|
struct rgba js2color(JSValue v);
|
2023-04-19 15:16:35 -05:00
|
|
|
double js2number(JSValue v);
|
2024-01-14 10:24:31 -06:00
|
|
|
JSValue number2js(double g);
|
2023-04-18 17:58:44 -05:00
|
|
|
JSValue int2js(int i);
|
2023-04-25 16:59:12 -05:00
|
|
|
JSValue str2js(const char *c);
|
2023-04-18 17:58:44 -05:00
|
|
|
|
2023-02-02 17:52:15 -06:00
|
|
|
#endif
|