1. rude
  2. love

Commits

Alex Szpakowski  committed fbd8fad

Added love.getVersion (resolves issue #809).

Syntax is: major, minor, revision, codename = love.getVersion().

  • Participants
  • Parent commits 6a885b3
  • Branches default

Comments (0)

Files changed (1)

File src/modules/love/love.cpp

View file
 	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");
 
 	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)