42 Commits

Author SHA1 Message Date
qiuguohua
62a9da122e Use sdl2 on mac platform (#16030)
* Use sdl2 on mac platform
2023-08-21 16:45:53 +08:00
minggo
a22d16bbe6 Merge branch 'v3.7.3' into merge_v3.7.3 2023-04-24 11:26:58 +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
qiuguohua
ee86fc40bd Native platform modifies exit process (#14141) 2023-02-15 17:11:28 +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
江战
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
江战
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
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
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
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
timlyeee
f0925edd69 listen WINDOW_RESIZE event by application (#10930) 2022-05-10 17:23:16 +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
minggo
8e7669bf92 replace assert with CC_ASSERT (#10913)
* replace assert with CC_ASSERT
2022-04-29 10:18:41 +08:00
qiuguohua
3f8f8fd65e Define CanvasTextAlign and CanvasTextBaseline enumeration in ICanvasRenderingContext2D (#10856) 2022-04-26 13:33:21 +08:00
Cocos Robot
bff1fbe17d [ci skip][AUTO]: Automated clang-format update: c7f0f9c103 (#10682) (#10717)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2022-04-11 11:11:30 +08:00
minggo
cd48cf7106 Replace CCASSERT with CC_ASSERT (#10682)
* replace CCASSERT with CC_ASSEERT
2022-04-10 16:03:46 +08:00
江战
e02b03ac4c 3.6 add linux ci (#10636)
* 3.6 add linux ci
2022-04-01 18:53:52 +08:00
minggo
a6bf766170 Merge branch 'v3.5.0' into v3.6_merge_v3.5 2022-03-29 18:26:40 +08:00
Cocos Robot
df50878b14 [ci skip][AUTO]: Automated clang-format update: 735860a2aa (#10560) (#10570)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2022-03-29 16:40:20 +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
qiuguohua
94f42b3c4b Add dynamic library export macro (#10393)
* Add dynamic library export macro
2022-03-21 11:17:11 +08:00
qiuguohua
6a16077bc5 SDL related interface encapsulation (#10385)
* SDL related interface encapsulation
2022-03-18 14:43:01 +08:00
Cocos Robot
c3f2f4a1cb [ci skip][AUTO]: Automated clang-format update: 3b49861e5f (#10261) (#10267)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
2022-03-09 13:38:22 +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
yangchao
e9e47b9dba do not create window in server mode (#10161)
* add no window impl
* add empty win impl file
2022-02-24 14:41:04 +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
Yun Hsiao Wu
14a17c9d22 license upgrade (#4210) 2022-01-24 17:18:47 +08:00
qiuguohua
6d79a24cab V3.5.0 (#4134)
* Temporarily solve the application is released, but other modules need to use application

* Solve the application is released, but other modules need to use application

* Solve some warnings about platform adaptation

* Fix the problem that the linux platform is not assigned
2022-01-07 09:47:13 +08:00
oahcy
5379e6ef35 引擎适配linux平台 (#4035) 2021-11-29 17:17:15 +08:00