Handling window minimizing

This commit is contained in:
Dynamitos
2023-12-28 21:42:18 +01:00
parent e18254ec29
commit 4b58ab84be
21 changed files with 109 additions and 76 deletions
+11 -1
View File
@@ -97,9 +97,13 @@ Window::~Window()
glfwDestroyWindow(static_cast<GLFWwindow *>(windowHandle));
}
void Window::beginFrame()
void Window::pollInput()
{
glfwPollEvents();
}
void Window::beginFrame()
{
vkAcquireNextImageKHR(graphics->getDevice(), swapchain, std::numeric_limits<uint64>::max(), imageAvailableSemaphores[currentSemaphoreIndex]->getHandle(), VK_NULL_HANDLE, &currentImageIndex);
swapChainTextures[currentImageIndex]->changeLayout(Gfx::SE_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
graphics->getGraphicsCommands()->getCommands()->waitForSemaphore(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, imageAvailableSemaphores[currentSemaphoreIndex]);
@@ -210,6 +214,12 @@ void Window::close()
void Window::resize(int width, int height)
{
if (width == 0 || height == 0)
{
paused = true;
return;
}
paused = false;
querySurface();
chooseSwapSurfaceFormat();
framebufferFormat = cast(format.format);