Engine
The Engine object that is used to run a Luwow application.
initialize
Initializes a new Luau state, sets the environment variables, and sandboxes the state.
Returns
luaRequire
Requires a module with the given path. The path must be used according to the require-by-string semantics.
If the path string points to a Luau module, its result after execution will be saved to the cache. Further requires will return this cached result to the Luau thread it was called from.
If the path string points to a native module, its exported functions will be returned in a table to the Luau thread it was called from.
Parameters
The pointer to the engine object. The Luau thread that the function is being called with. The path string that can either point to an alias, Luau module, or a native module.
Returns
loadModuleFromBytecode
int loadModuleFromBytecode(lua_State* L, const std::string& moduleName, const std::string& bytecode, bool saveRef, bool useGivenState)
Executes a module with its bytecode in a new sandboxed Luau thread. If the engine has a debugger callback function, it will be called with the new thread state from this function.
Parameters
The Luau thread that the function is being called with. The module name that represents the Luau module. The bytecode of the Luau module that will be executed. Whether or not the engine will save the result to the cache. Whether or not the engine will use the given lua_State* to create the new thread.
Returns
registerNativeModule
Registers a new native module to the engine. The module can then be required from Luau using its defined alias.
Parameters
The pointer to the
ILuauModule that will be registered.
Returns
run
Runs the engine. Should be called the last after initialization.
If the engine has been given a package, it will attempt to run the package contents.
If the engine has been given a Luau module with a compiler callback, it will first compile the module using the callback, and then run it.
Returns