summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-02-23 13:47:27 -0600
committersanine <sanine.not@pm.me>2023-02-23 13:47:27 -0600
commitf1ab76b1185247ca688f59f36d99f298d25c07b5 (patch)
tree9d0882968499462cc1638c21c10c9fc6f1600dad
parentd61633a46ba4b6b3dce72e8d3cb20807f3f1add7 (diff)
add glm.version()
-rw-r--r--src/glm/setup.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glm/setup.c b/src/glm/setup.c
index 332987b..be12c80 100644
--- a/src/glm/setup.c
+++ b/src/glm/setup.c
@@ -1,5 +1,6 @@
#include <lua.h>
#include <lauxlib.h>
+#include <cglm/version.h>
#include "util/util.h"
#include "glm.h"
@@ -13,6 +14,15 @@ const char *glm_vec4_tname = "glm.vec4";
const char *glm_versor_tname = "glm.versor";
+int glm_version(lua_State *L)
+{
+ lua_pushinteger(L, CGLM_VERSION_MAJOR);
+ lua_pushinteger(L, CGLM_VERSION_MINOR);
+ lua_pushinteger(L, CGLM_VERSION_PATCH);
+ return 3;
+}
+
+
void setup_glm(lua_State *L, int honey_index)
{
luaL_newmetatable(L, glm_mat2_tname); lua_pop(L, 1);
@@ -27,6 +37,7 @@ void setup_glm(lua_State *L, int honey_index)
#define X(name, func) H_FUNC(name, func),
GLM_FUNCTIONS
#undef X
+ H_FUNC("version", glm_version),
H_END,
};
create_table(L, glm);