From f1ab76b1185247ca688f59f36d99f298d25c07b5 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 23 Feb 2023 13:47:27 -0600 Subject: add glm.version() --- src/glm/setup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/glm') 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 #include +#include #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); -- cgit v1.2.1