diff options
author | sanine-a <sanine.not@pm.me> | 2020-10-25 12:56:16 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2020-10-25 12:56:16 -0500 |
commit | c5874a0fc256a429b682f14344fca74fd0deab3a (patch) | |
tree | 81deeffab51f4cb30f74855066b4d92a87f406e2 /src/cglm_bindings.h | |
parent | 8dbfbdc929c2321f23b50754eda8fbcdba00ad03 (diff) |
add basic cglm binding functions
Diffstat (limited to 'src/cglm_bindings.h')
-rw-r--r-- | src/cglm_bindings.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/cglm_bindings.h b/src/cglm_bindings.h new file mode 100644 index 0000000..eaadc98 --- /dev/null +++ b/src/cglm_bindings.h @@ -0,0 +1,47 @@ +#ifndef HONEY_CGLM_BINDINGS_H +#define HONEY_CGLM_BINDINGS_H + +#include "common.h" + +/** @brief Push the honey cglm binding functions to the lua stack. + * + * @returns Nothing. + */ +void honey_setup_cglm(lua_State* L); + +/** @brief Push a new float array to the lua stack. + * + * This function initializes the array to all zeros. + * + * @param[in] n The size of the floating-point array to create. + * + * @returns The vector so generated. + */ +int honey_cglm_new_array_zero(lua_State* L); + +/** @brief Set an element of a float array. + * + * This function does NOT check if your index is out of bounds. + * Use caution! + * + * @param[in] array The array to modify. + * @param[in] index The index to set. + * @param[in] value The value to set array[index] to. + * + * @returns Nothing. + */ +int honey_cglm_array_set_value(lua_State* L); + +/** @brief Get an element of a vec3. + * + * This function does NOT check if your index is out of bounds. + * Use caution! + * + * @param[in] array The array to inspect. + * @param[in] index The index to get. + * + * @returns The value at array[index]. + */ +int honey_cglm_array_get_value(lua_State* L); + +#endif |