90 Commits

Author SHA1 Message Date
bofeng-song
10ba4952ac refactor CocosActivity (#16203)
* refactor CocosActivity
2023-09-08 11:52:13 +08:00
oahc09
22ab4b2e44 improve:xr pico use vk1.1 (#15959) 2023-08-15 15:07:37 +08:00
qiuguohua
343393942c Fix harmonyos platform compilation failure. (#15262) 2023-06-02 14:55:55 +08:00
minggo
a22d16bbe6 Merge branch 'v3.7.3' into merge_v3.7.3 2023-04-24 11:26:58 +08:00
oahc09
63bdc9ff4a feat:xr interface support async load asset image (#14876) 2023-04-23 09:27:55 +08:00
qiuguohua
8303d7fb8c Move the copyTextToClipboard interface from SystemWindow to System (#14729)
* Move the copyTextToClipboard interface from SystemWindow to System

* Use file names with the same case as the directory name
2023-04-07 11:09:08 +08:00
oahc09
8abee5fe1c feat:xr interface support xr eye render js callback (#14665) 2023-03-27 16:07:23 +08:00
江战
cdfd194c4c Add HPE Feature Detetion and JNI Method Refactoring (#14633) 2023-03-26 16:26:45 +08:00
James Chen
937eb10402 [android] Remove dependence of Activity, prepare for surface-less rendering (#14612)
* Use `context` instead of `activity` as possible.

* Remove unused JniNativeGlue.h include.

* Remove unused import.

* Update JniHelper.h/.cpp, JniHelper::sActivity -> JniHelper::sContext.

* Fix log output name in CocosHelper.java

* Rename the second parameter JniHelper::init from `activity` to `context`.

* Update todo in JniHelper::getActivity()
2023-03-21 11:54:23 +08:00
santy-wang
0a81bf445e Merge branch 'develop' of github.com:cocos-creator/engine into v3.7.2 2023-03-13 16:51:47 +08:00
oahc09
2a3904d723 feat:pass cocos engine version parameter to xr library (#14413) 2023-03-01 13:51:46 +08:00
oahc09
52484a619c refactor:xr 2d orthographic camera ui display effect (#14371) 2023-02-24 18:07:47 +08:00
oahc09
85a400998a feat:xr support adb command controller/activity lifecycle callback (#14334)
* feat:support adb command controller/activity lifecycle callback to native xr

* improve:replace getInterface<IXRInterface>() with CC_GET_XR_INTERFACE()
2023-02-24 16:37:23 +08:00
James Chen
60efd41c26 Merge pull request #14330 from cocos/v3.7.2
Merges v3.7.2 to develop
2023-02-22 09:40:48 +08:00
oahc09
0ca43fd57c improve:skip some xr logic when xr entry instance is invalid (#14304) 2023-02-21 09:48:00 +08:00
qiuguohua
ee86fc40bd Native platform modifies exit process (#14141) 2023-02-15 17:11:28 +08:00
minggo
313c58fe33 Improve utils api doc (#13922) 2022-12-28 15:04:56 +08:00
fqamic
1f928364f4 fix some xr devices stretch when splash-screen logo and add handle device key (#13915)
* fix: some xr devices stretch when splash-screen logo

* feat: xr handle device support button menu and button start
2022-12-28 11:56:35 +08:00
pandamicro
afd22296b4 MIT license update and to new year 2023 (#13927)
* Cpp MIT license update and to date
* TS MIT license update and to date
2022-12-28 11:25:12 +08:00
OnlyKoei
e0cd2932b7 Update Android KeepScreenOn handling (#13746) 2022-12-08 17:47:42 +08:00
qiuguohua
dac1b5025f 1、Fix the problem of Harmony not running (#13735)
2、Modify setassetmanager to setAssetManager
2022-12-08 13:36:41 +08:00
bofeng-song
6df0caca16 Android: fix deadlock for update nativeWindow (#13709)
* Android:   fix deadlock for update nativeWindow
2022-12-07 15:40:05 +08:00
oahc09
0dd67aee0b fix:android activity jni global reference leak (#13631)
* fix:android activity jni global reference leak

* improve:only release jniObjectActivity,keep classloader
add nullptr check for classloader to avoid new global reference many times
2022-12-07 11:48:03 +08:00
江战
046a2b1378 Re-impl CC_ASSERT & CC_ASSERTF (#13588) 2022-12-05 17:12:30 +08:00
James Chen
62d8b4daae Remove unused swapWindow methods. (#13356)
The operation of swapping (presenting) buffers is done in gfx::Device::present. To swap multi-systemwindows, multiple gfx swapchains need be created, and relevant gfx backend will iterate each swapchain and present them. Therefore, `swap buffers` operation doesn't need to be in SystemWindow or SystemWindowManager.

```c++
void GLES3Device::present() {
    CC_PROFILE(GLES3DevicePresent);
    auto *queue = static_cast<GLES3Queue *>(_queue);
    _numDrawCalls = queue->_numDrawCalls;
    _numInstances = queue->_numInstances;
    _numTriangles = queue->_numTriangles;

    bool isGFXDeviceNeedsPresent = _xr ? _xr->isGFXDeviceNeedsPresent(_api) : true;
    for (auto *swapchain : _swapchains) { // We iterate each swapchain and do the present thing here.
        if (isGFXDeviceNeedsPresent) _gpuContext->present(swapchain);
    }
    if (_xr) _xr->postGFXDevicePresent(_api);

    // Clear queue stats
    queue->_numDrawCalls = 0;
    queue->_numInstances = 0;
    queue->_numTriangles = 0;
}
```

Besides, `SDL_GL_SwapWindow` invocation is doing nothing on Windows & Linux platforms, it will generate an SDL an error that `The specified window isn't an OpenGL window` because GL context is not created by SDL_GL_CreateContext. We create contexts in our gfx code.

https://github.com/libsdl-org/SDL/blob/main/src/video/SDL_video.c#L4192

```c++

#define NOT_AN_OPENGL_WINDOW "The specified window isn't an OpenGL window"
int
SDL_GL_SwapWindowWithResult(SDL_Window * window)
{
    CHECK_WINDOW_MAGIC(window, -1);

    if (!(window->flags & SDL_WINDOW_OPENGL)) {
        return SDL_SetError(NOT_AN_OPENGL_WINDOW);
    }

    if (SDL_GL_GetCurrentWindow() != window) {
        return SDL_SetError("The specified window has not been made current");
    }

    return _this->GL_SwapWindow(_this, window);
}

void
SDL_GL_SwapWindow(SDL_Window * window)
{
    SDL_GL_SwapWindowWithResult(window);
}
```

Also, SDL_GL_SwapWindow could not take any effect if running on gfx Vulkan backend.

```c++
void SDLHelper::swapWindow(SDL_Window *window) {
    SDL_GL_SwapWindow(window);
}
```
2022-11-14 11:46:58 +08:00
oahc09
70b81a9d8c [feature] xr remote preview (#13247)
* feat:add xr remote preview feature

send xr device's pose info to web browser or editor

* feat:add xr remote preview feature

* fix:clang tidy error
2022-11-09 15:02:12 +08:00
江战
280fd976bc Add EventTarget & EventBus (#13100) 2022-10-28 15:44:33 +08:00
ycg
4e545eb4cb Add Hindi language. (#13084) 2022-10-19 14:32:49 +08:00
林玮
eab2d646c6 Change windowHandle to windowId when EVENT_DESTROY_WINDOW (#12848)
* Change windowHandle to windowId when EVENT_DESTROY_WINDOW

* fix: resolution issue on iOS
2022-09-22 15:45:56 +08:00
bofeng-song
82cbdfb232 fix crash while dynamic call createSurface (#12829)
* fix crash while dynamic call createSurface

* Fix the application crash when returning from the background to the foreground
2022-09-22 10:57:12 +08:00
bofeng-song
6189898878 support create surfaceview dynamically at android platform (#12551)
* support create surfaceview dynamically at android platform
2022-09-20 11:38:42 +08:00
minggo
bd0fcc67c4 move cocos/core/pipeline to cocos/rendering (#12797)
* move cocos/core/pipeline to cocos/rendering
2022-09-16 16:10:26 +08:00
林玮
785fd91511 Add multi-windows support (#12243)
Co-authored-by: bofeng.song <bofeng.song@chukong-inc.com>
2022-09-15 14:55:44 +08:00
minggo
aba9fdb63f Merge branch 'v3.6.1' into merge_v3.6.1 2022-09-02 20:08:18 +08:00
timlyeee
88cdfd71e3 [android] Fix local reference table overflow when use callStaticStringMethod (#12621) 2022-08-31 11:13:20 +08:00
minggo
834cfa66af Merge branch 'v3.6.1' into merge_v3.6.1 2022-08-23 14:13:02 +08:00
QingliWang
6a8f53b186 Add features for XR developement. (#12413)
* Change Android mainloop, add global config and template projects for XR.

* Change gfx/gles device's process flow for XR, working with other PRs, waiting.

* Change gfx/Vulkan device's process flow for XR, working with other PRs, waiting.

* Change render process for XR.

* Develop XR input and events.

* Develop 3D feature of UI widgets and raycast effect for XR.

Co-authored-by: fqamic <fqamic@vip.qq.com>
2022-08-22 16:34:45 +08:00
bofeng-song
9c7df0123c context2d support shadow attribute at Android platform (#12332) 2022-08-08 10:14:59 +08:00
minggo
d40b8739bc Merge branch 'v3.6.0' into develop_merge_v3.6 2022-07-18 10:38:14 +08:00
bofeng-song
113fad0259 refine: rename windowHanler to windowHandle, rename onDestory to onDestroy (#11907) 2022-07-09 13:54:18 +08:00
timlyeee
b43de1af07 V3.6.0 exit (#11856) 2022-07-07 14:07:47 +08:00
qiuguohua
6e693451a5 deviceevent related issues (#11308)
* dispatchOrientationChangeEvent is not called
2022-06-01 14:47:18 +08:00
James Chen
024737aebc fixed #11195: Rename cc::optional, cc::any, cc::variant to ccstd::optional, ccstd::any, ccstd::variant (#11197)
* Move Any.h/Optional.h/Variant.h to base/std and rename them to lowercase.

* fixed #11195: Rename cc::optional, cc::any, cc::variant to ccstd::optional, ccstd::any, ccstd::variant

* Format code.
2022-05-24 18:47:16 +08:00
minggo
7814949998 Merge branch 'v3.5.1' into v3.6.0_merge_v3.5.1 2022-05-24 11:53:57 +08:00
bofeng-song
a2afcd2cdb disable gametick after enter background(revert to logic to version 3.4.2) (#11095) 2022-05-14 18:33:36 +08:00
James Chen
d8761f60a8 Fix the linking error if audio module is disabled in project configuration. (#10940) 2022-05-05 17:58:34 +08:00
minggo
271cc5cf23 Remove some format rule (#10919)
* remove some rules
* format all codes with new format rule
2022-05-04 13:09:24 +08:00
qiuguohua
3f8f8fd65e Define CanvasTextAlign and CanvasTextBaseline enumeration in ICanvasRenderingContext2D (#10856) 2022-04-26 13:33:21 +08:00
minggo
84c27e7f71 Merge branch 'v3.5.0' into v3.6.0_merge_v3.5 2022-04-24 13:41:27 +08:00
bofeng-song
ef7d80f8ae integrate game-activity (#10794) 2022-04-22 13:48:43 +08:00