53 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
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
bofeng-song
6df0caca16 Android: fix deadlock for update nativeWindow (#13709)
* Android:   fix deadlock for update nativeWindow
2022-12-07 15:40:05 +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
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
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
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
bofeng-song
ef7d80f8ae integrate game-activity (#10794) 2022-04-22 13:48:43 +08:00
minggo
ef013fc8c3 Remove ssize_t (#10664) 2022-04-07 17:17:18 +08:00
minggo
a6bf766170 Merge branch 'v3.5.0' into v3.6_merge_v3.5 2022-03-29 18:26:40 +08:00
minggo
1a9d49e4c6 replace std::list/std::array with ccstd::list/ccstd::array (#10560)
* replace std::list/std::array with ccstd::list/ccstd::array
2022-03-29 16:36:53 +08:00
qiuguohua
b6af1ada02 V3.5.0 create window (#10481)
* 1. Modify the parameters of the creation window
2. Modify the relationship between platform and interface
3. Rename vibrate to vibrator in linux and QNX

* Fix empty platform implementation

* Fix empty platform implementation

* Modify mac and ios createwindow interface

* Create a centered window by default

* Mobile platforms do not require window creation
2022-03-25 18:43:17 +08:00
Cocos Robot
a2df4e4dbd [ci skip][AUTO]: Automated clang-format update: 771de57fc2 (#10469) (#10472)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2022-03-24 13:50:39 +08:00
minggo
7f4cb9e3b1 Remove string (#10469)
* replace std::string with ccstd::string
2022-03-24 11:53:10 +08:00
minggo
34bf14269c unify stl (#10402)
* add ccstd::vector
* replace cc::vector with ccstd::vector 
* replace std::vector with ccstd::vector
* do not include <vector>
2022-03-21 15:55:02 +08:00
minggo
73c303f556 Merge branch 'v3.5.0' into merge_v3.5.0 2022-03-08 14:53:00 +08:00
Cocos Robot
2cfc659779 [ci skip][AUTO]: Automated clang-format update: dc993f3861 (#10211) (#10222)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2022-03-02 10:17:46 +08:00
bofeng-song
141128f148 refine context2d, reduce call from native to js (#10211)
* reduce c++ callback to js
2022-03-02 09:56:00 +08:00
minggo
7f24f34b22 Merge branch 'v3.5.0' into v3.6_merge_v3.5.0 2022-01-25 19:52:06 +08:00
minggo
f08555248f fix conflict 2022-01-24 17:23:03 +08:00