prosperon/source/engine/jsffi.h

24 lines
440 B
C
Raw Normal View History

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"
#include <chipmunk/chipmunk.h>
2023-05-16 01:31:13 -05:00
#include "2dphysics.h"
2023-01-10 07:13:00 -06:00
void ffi_load();
2023-04-18 14:49:17 -05:00
JSValue vec2js(cpVect v);
cpVect js2vec2(JSValue v);
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-05-16 01:31:13 -05:00
struct rgba js2color(JSValue v);
2023-04-19 15:16:35 -05:00
double js2number(JSValue v);
2023-04-18 17:58:44 -05:00
JSValue num2js(double g);
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
#endif