mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
fix: editor and cocos-play issues (#12908)
* fix: editor and cocos-play issues * * Change 'windowId' to optional.
This commit is contained in:
@@ -50,8 +50,13 @@ int BaseGame::init() {
|
||||
std::call_once(_windowCreateFlag, [&]() {
|
||||
ISystemWindowInfo info;
|
||||
info.title = _windowInfo.title;
|
||||
#if CC_PLATFORM == CC_PLATFORM_WINDOWS
|
||||
info.x = _windowInfo.x == -1 ? 50 : _windowInfo.x; // 50 meams move window a little for now
|
||||
info.y = _windowInfo.y == -1 ? 50 : _windowInfo.y; // same above
|
||||
#else
|
||||
info.x = _windowInfo.x == -1 ? 0 : _windowInfo.x;
|
||||
info.y = _windowInfo.y == -1 ? 0 : _windowInfo.y;
|
||||
#endif
|
||||
info.width = _windowInfo.width;
|
||||
info.height = _windowInfo.height;
|
||||
info.flags = _windowInfo.flags;
|
||||
|
||||
@@ -167,7 +167,7 @@ void Root::destroy() {
|
||||
// this.dataPoolManager.clear();
|
||||
}
|
||||
|
||||
void Root::resize(uint32_t windowId, uint32_t width, uint32_t height) {
|
||||
void Root::resize(uint32_t width, uint32_t height, uint32_t windowId) {
|
||||
for (const auto &window : _renderWindows) {
|
||||
auto *swapchain = window->getSwapchain();
|
||||
if (swapchain && (swapchain->getWindowId() == windowId)) {
|
||||
|
||||
@@ -76,10 +76,11 @@ public:
|
||||
/**
|
||||
* @zh
|
||||
* 重置大小
|
||||
* @param width 屏幕宽度
|
||||
* @param height 屏幕高度
|
||||
* @param width 窗口宽度
|
||||
* @param height 窗口高度
|
||||
* @param windowId 窗口 ID
|
||||
*/
|
||||
void resize(uint32_t windowId, uint32_t width, uint32_t height);
|
||||
void resize(uint32_t width, uint32_t height, uint32_t windowId);
|
||||
|
||||
bool setRenderPipeline(pipeline::RenderPipeline *rppl = nullptr);
|
||||
void onGlobalPipelineStateChanged();
|
||||
|
||||
Reference in New Issue
Block a user