MCPcopy Create free account
hub / github.com/defold/defold / Sys_GetEngineInfo

Function Sys_GetEngineInfo

engine/script/src/script_sys.cpp:883–903  ·  view source on GitHub ↗

get engine information * * Returns a table with engine information. * * @name sys.get_engine_info * @return engine_info [type:table] table with engine information in the following fields: * * `version` * : [type:string] The current Defold engine version, i.e. "1.2.96" * * `version_sha1` * : [type:string] The SHA1 for the current engine build,

Source from the content-addressed store, hash-verified

881 * ```
882 */
883 static int Sys_GetEngineInfo(lua_State* L)
884 {
885 int top = lua_gettop(L);
886
887 dmSys::EngineInfo info;
888 dmSys::GetEngineInfo(&info);
889
890 lua_newtable(L);
891 lua_pushliteral(L, "version");
892 lua_pushstring(L, info.m_Version);
893 lua_rawset(L, -3);
894 lua_pushliteral(L, "version_sha1");
895 lua_pushstring(L, info.m_VersionSHA1);
896 lua_rawset(L, -3);
897 lua_pushliteral(L, "is_debug");
898 lua_pushboolean(L, info.m_IsDebug);
899 lua_rawset(L, -3);
900
901 assert(top + 1 == lua_gettop(L));
902 return 1;
903 }
904
905 /*# get application information
906 *

Callers

nothing calls this directly

Calls 6

lua_gettopFunction · 0.85
GetEngineInfoFunction · 0.85
lua_pushstringFunction · 0.85
lua_rawsetFunction · 0.85
lua_pushbooleanFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected