| 539 | } |
| 540 | |
| 541 | void WindowBase::Show() |
| 542 | { |
| 543 | const auto clientSize = GetClientSize(); |
| 544 | const auto width = static_cast<int32>(clientSize.X); |
| 545 | const auto height = static_cast<int32>(clientSize.Y); |
| 546 | _visible = true; |
| 547 | |
| 548 | // Ensure to have backbuffer and swapchain ready |
| 549 | if (InitSwapChain()) |
| 550 | { |
| 551 | Platform::Fatal(TEXT("Cannot init rendering output for a window.")); |
| 552 | } |
| 553 | |
| 554 | if (RenderTask) |
| 555 | { |
| 556 | // Resize render task to fit WindowBase client size |
| 557 | RenderTask->Resize(width, height); |
| 558 | |
| 559 | // Enable rendering |
| 560 | RenderTask->Enabled = true; |
| 561 | } |
| 562 | |
| 563 | // Call GUI event |
| 564 | OnResize(width, height); |
| 565 | OnShow(); |
| 566 | } |
| 567 | |
| 568 | void WindowBase::Hide() |
| 569 | { |
nothing calls this directly
no test coverage detected