16 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
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
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
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
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
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
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
a6bf766170 Merge branch 'v3.5.0' into v3.6_merge_v3.5 2022-03-29 18:26:40 +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
minggo
7f4cb9e3b1 Remove string (#10469)
* replace std::string with ccstd::string
2022-03-24 11:53:10 +08:00
Yun Hsiao Wu
14a17c9d22 license upgrade (#4210) 2022-01-24 17:18:47 +08:00
oahcy
5379e6ef35 引擎适配linux平台 (#4035) 2021-11-29 17:17:15 +08:00