ScriptX provides some basic interfaces to interoperate with native engine APIs. These basic interfaces appear in the form of auxiliary classes.
such as:
V8
->script::v8_interop
JavaScriptCore
->script::jsc_interop
Lua
->script::lua_interop
Mainly provide capabilities:
- Get the internal native engine instance from the engine pointer
- Conversion of
script::Local
reference and native reference type - Conversion of
script::Arguments
and native call parameters
These xx_interop
auxiliary classes will only appear when the corresponding backend is selected at compile time, so macro isolation is required when calling related APIs.
See InteroperateTest for details
ScriptX positions itself as a helper to help you call the native engine API, but when the helper is weak (the ability is not exposed), you can do it yourself at any time!