summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);