diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index 77fe5b208..7bb700b76 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -170,6 +170,15 @@ const char *love_codename() return love::VERSION_CODENAME; } +static int w_love_getVersion(lua_State *L) +{ + lua_pushinteger(L, love::VERSION_MAJOR); + lua_pushinteger(L, love::VERSION_MINOR); + lua_pushinteger(L, love::VERSION_REV); + lua_pushstring(L, love::VERSION_CODENAME); + return 4; +} + int luaopen_love(lua_State * L) { love::luax_insistglobal(L, "love"); @@ -203,6 +212,9 @@ int luaopen_love(lua_State * L) lua_setfield(L, -2, "_version_compat"); + lua_pushcfunction(L, w_love_getVersion); + lua_setfield(L, -2, "getVersion"); + #ifdef LOVE_WINDOWS lua_pushstring(L, "Windows"); #elif defined(LOVE_MACOSX)