diff --git a/native/cocos/platform/interfaces/modules/XRCommon.h b/native/cocos/platform/interfaces/modules/XRCommon.h index 216dae5a6e..7f1c8b330a 100644 --- a/native/cocos/platform/interfaces/modules/XRCommon.h +++ b/native/cocos/platform/interfaces/modules/XRCommon.h @@ -104,6 +104,11 @@ enum class XRConfigKey { ACTIVITY_LIFECYCLE = 40, NATIVE_WINDOW = 41, SPLIT_AR_GLASSES = 42, + ENGINE_VERSION = 43, + RECENTER_HMD = 44, + RECENTER_CONTROLLER = 45, + FOVEATION_LEVEL = 46, + DISPLAY_REFRESH_RATE = 47, MAX_COUNT }; diff --git a/native/cocos/platform/java/modules/XRInterface.cpp b/native/cocos/platform/java/modules/XRInterface.cpp index 8ae1e99fa7..6d0e788894 100644 --- a/native/cocos/platform/java/modules/XRInterface.cpp +++ b/native/cocos/platform/java/modules/XRInterface.cpp @@ -27,6 +27,7 @@ #include #include #include +#include "cocos-version.h" #include "android/AndroidPlatform.h" #include "base/Log.h" #include "base/Macros.h" @@ -441,6 +442,7 @@ void XRInterface::initialize(void *javaVM, void *activity) { xr::XrEntry::getInstance()->setHandleCallback(std::bind(&XRInterface::dispatchHandleEventInternal, this, std::placeholders::_1)); xr::XrEntry::getInstance()->setHMDCallback(std::bind(&XRInterface::dispatchHMDEventInternal, this, std::placeholders::_1)); xr::XrEntry::getInstance()->setXRConfig(xr::XRConfigKey::LOGIC_THREAD_ID, static_cast(gettid())); + xr::XrEntry::getInstance()->setXRConfig(xr::XRConfigKey::ENGINE_VERSION, COCOS_VERSION); xr::XrEntry::getInstance()->setXRConfigCallback([this](xr::XRConfigKey key, xr::XRConfigValue value) { if (IS_ENABLE_XR_LOG) CC_LOG_INFO("XRConfigCallback.%d", key); if (key == xr::XRConfigKey::RENDER_EYE_FRAME_LEFT || key == xr::XRConfigKey::RENDER_EYE_FRAME_RIGHT) {