HarmonyOS Next implements game.end interface (#18473)

This commit is contained in:
qiuguohua
2025-03-17 19:39:50 +08:00
committed by GitHub
parent d0fd640f93
commit cc47fce6bc
2 changed files with 6 additions and 1 deletions

View File

@@ -27,6 +27,7 @@
#include "base/Log.h"
#include "base/Macros.h"
#include "platform/openharmony/OpenHarmonyPlatform.h"
#include "platform/openharmony/napi/NapiHelper.h"
namespace cc {
@@ -76,6 +77,10 @@ void SystemWindow::setViewSize(uint32_t width, uint32_t height) {
_height = height;
}
void SystemWindow::closeWindow() {
NapiHelper::napiCallFunction("terminateProcess");
}
SystemWindow::Size SystemWindow::getViewSize() const {
return Size{static_cast<float>(_width),
static_cast<float>(_height)};

View File

@@ -46,7 +46,7 @@ public:
void setWindowHandle(void* window);
Size getViewSize() const override;
void setViewSize(uint32_t width, uint32_t height) override;
void closeWindow() override;
/**
@brief enable/disable(lock) the cursor, default is enabled
*/